module documentation

Utils for CLI commands

Function GetResult Waits for jobs and returns whether they have succeeded
def GetResult(cl, opts, result):

Waits for jobs and returns whether they have succeeded

Some OpCodes return of list of jobs. This function can be used after issueing a given OpCode to look at the OpCode's result and, if it is of type ht.TJobIdListOnly, then it will wait for the jobs to complete, otherwise just return constants.EXIT_SUCCESS.

Parameters
cl:ganeti.luxi.Clientclient that was used to submit the OpCode, which will also be used to poll the jobs
optsCLI options
resultresult of the opcode which might contain job information, in which case the jobs will be polled, or simply the result of the opcode
Returns
intconstants.EXIT_SUCCESS if all jobs completed successfully, constants.EXIT_FAILURE otherwise