Package ganeti :: Module cli :: Class JobExecutor
[hide private]
[frames] | no frames]

Class JobExecutor

source code


Class which manages the submission and execution of multiple jobs.

Note that instances of this class should not be reused between GetResults() calls.

Instance Methods [hide private]
 
__init__(self, cl=None, verbose=True, opts=None, feedback_fn=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
QueueJob(self, name, *ops)
Record a job for later submit.
source code
 
AddJobId(self, name, status, job_id)
Adds a job ID to the internal queue.
source code
 
SubmitPending(self, each=False)
Submit all pending jobs.
source code
 
_ChooseJob(self)
Choose a non-waiting/queued job to poll next.
source code
list
GetResults(self)
Wait for and return the results of all jobs.
source code
 
WaitOrShow(self, wait)
Wait for job results or only print the job IDs.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_IfName(name, fmt)
Helper function for formatting name.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cl=None, verbose=True, opts=None, feedback_fn=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

QueueJob(self, name, *ops)

source code 

Record a job for later submit.

Parameters:
  • name (string) - a description of the job, will be used in WaitJobSet

GetResults(self)

source code 

Wait for and return the results of all jobs.

Returns: list
list of tuples (success, job results), in the same order as the submitted jobs; if a job has failed, instead of the result there will be the error message

WaitOrShow(self, wait)

source code 

Wait for job results or only print the job IDs.

Parameters:
  • wait (boolean) - whether to wait or not