Package ganeti :: Package client :: Module base
[hide private]
[frames] | no frames]

Module base

source code

Utils for CLI commands

Functions [hide private]
int
GetResult(cl, opts, result)
Waits for jobs and returns whether they have succeeded
source code

Imports: cli, constants, ht


Function Details [hide private]

GetResult(cl, opts, result)

source code 

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.Client) - client that was used to submit the OpCode, which will also be used to poll the jobs
  • opts - CLI options
  • result - result of the opcode which might contain job information, in which case the jobs will be polled, or simply the result of the opcode
Returns: int
constants.EXIT_SUCCESS if all jobs completed successfully, constants.EXIT_FAILURE otherwise