Module locking
source code
Module implementing the Ganeti locking code.
|
_EXCLUSIVE_TEXT = "exclusive"
|
|
_SHARED_TEXT = "shared"
|
|
_DELETED_TEXT = "deleted"
|
|
_DEFAULT_PRIORITY = 0
|
|
ALL_SET = None
|
|
LEVEL_CLUSTER = 0
|
|
LEVEL_INSTANCE = 1
|
|
LEVEL_NODEGROUP = 2
|
|
LEVEL_NODE = 3
|
|
LEVELS = [LEVEL_CLUSTER, LEVEL_INSTANCE, LEVEL_NODEGROUP, LEVE...
|
|
LEVELS_MOD = [LEVEL_NODE, LEVEL_NODEGROUP, LEVEL_INSTANCE]
|
|
LEVEL_NAMES = {LEVEL_CLUSTER: "cluster", LEVEL_INSTANCE: "inst...
|
|
BGL = 'BGL'
|
Imports:
os,
select,
threading,
errno,
weakref,
logging,
heapq,
operator,
itertools,
errors,
utils,
compat,
query
Shared Synchronization decorator.
Calls the function holding the given lock, either in exclusive or
shared mode. It requires the passed lock to be a SharedLock (or support
its semantics).
- Parameters:
mylock (lockable object or string) - lock to acquire or class member name of the lock to acquire
|
Sorting key function.
Sort by name, then by incoming order.
|
LEVELS
- Value:
[LEVEL_CLUSTER, LEVEL_INSTANCE, LEVEL_NODEGROUP, LEVEL_NODE]
|
|
LEVEL_NAMES
- Value:
{LEVEL_CLUSTER: "cluster", LEVEL_INSTANCE: "instance", LEVEL_NODEGROUP
: "nodegroup", LEVEL_NODE: "node",}
|
|