The purpose of this small library is to manage locking for ganeti
clusters in a central place, while at the same time doing dynamic checks
against possible deadlocks. It will also make it easier to transition to
a different lock type should we migrate away from python threads.
|
__init__(self,
node_uuids,
nodegroups,
instance_names,
networks)
Constructs a new GanetiLockManager object. |
source code
|
|
|
|
|
|
|
|
|
is_owned(self,
level)
Check whether we are owning locks at the given level |
source code
|
|
|
list_owned(self,
level)
Get the set of owned locks at the given level |
source code
|
|
|
check_owned(self,
level,
names,
shared=-1)
Check if locks at a certain level are owned in a specific mode. |
source code
|
|
|
|
|
_upper_owned(self,
level)
Check that we don't own any lock at a level greater than the given
one. |
source code
|
|
|
|
|
acquire(self,
level,
names,
timeout=None,
shared=0,
priority=None,
opportunistic=False)
Acquire a set of resource locks, at the same level. |
source code
|
|
|
downgrade(self,
level,
names=None)
Downgrade a set of resource locks from exclusive to shared mode. |
source code
|
|
|
release(self,
level,
names=None)
Release a set of resource locks, at the same level. |
source code
|
|
|
add(self,
level,
names,
acquired=0,
shared=0)
Add locks at the specified level. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|