class documentation
class Processor(object):
Object which runs OpCodes
Method | __init__ |
Constructor for Processor |
Method |
|
Undocumented |
Method |
|
Execute an opcode. |
Method |
|
Returns the current execution context ID. |
Method |
|
Forward call to feedback callback function. |
Method |
|
Log an informational message to the logs and the user. |
Method |
|
Log a change in LU execution progress. |
Method |
|
Log a warning to the logs and the user. |
Constant | DISPATCH |
Undocumented |
Instance Variable | cfg |
Undocumented |
Instance Variable | hmclass |
Undocumented |
Instance Variable | rpc |
Undocumented |
Instance Variable | wconfd |
Undocumented |
Method | _ |
Acquires locks via the Ganeti lock manager. |
Method | _ |
Checks if locking is enabled. |
Method | _ |
Check the LU result against the contract in the opcode. |
Method | _ |
Logical Unit execution sequence. |
Method | _ |
Execute a Logical Unit, with the needed locks. |
Method | _ |
Request locks from WConfD and wait for them to be granted. |
Instance Variable | _cbs |
Undocumented |
Instance Variable | _ec |
Undocumented |
Instance Variable | _enable |
Undocumented |
Instance Variable | _wconfdcontext |
Undocumented |
Constructor for Processor
Parameters | |
context:GanetiContext | global Ganeti context |
ec | execution context identifier |
enable | Undocumented |
Execute an opcode.
Parameters | |
op:an OpCode instance | the opcode to be executed |
cbs:OpExecCbBase | Runtime callbacks |
timeout:float or None | Maximum time to acquire all locks, None for no timeout |
Raises | |
LockAcquireTimeout | In case locks couldn't be acquired in specified amount of time |
Log a warning to the logs and the user.
The optional keyword argument is 'hint' and can be used to show a hint to the user (presumably related to the warning). If the message is empty, it will not be printed at all, allowing one to show only a hint.
def _AcquireLocks(self, level, names, shared, opportunistic, timeout, opportunistic_count=1, request_only=False):
¶
Acquires locks via the Ganeti lock manager.
Parameters | |
level:int | Lock level |
names:list or string | Lock names |
shared:bool | Whether the locks should be acquired in shared mode |
opportunistic:bool | Whether to acquire opportunistically |
timeout:None or float | Timeout for acquiring the locks |
opportunistic | Undocumented |
request | do not acquire the locks, just return the request |
Raises | |
LockAcquireTimeout | In case locks couldn't be acquired in specified amount of time; in this case, locks still might be acquired or a request pending. |
Execute a Logical Unit, with the needed locks.
This is a recursive function that starts locking the given level, and proceeds up, till there are no more locks to acquire. Then it executes the given LU and its opcodes.
Request locks from WConfD and wait for them to be granted.
Parameters | |
request:list | the lock request to be sent to WConfD |
timeout:float | the time to wait for the request to be granted |
Raises | |
LockAcquireTimeout | In case locks couldn't be acquired in specified amount of time; in this case, locks still might be acquired or a request pending. |