Revision 4e07ec8c
b/lib/locking.py | ||
---|---|---|
142 | 142 |
Args: |
143 | 143 |
shared: whether to acquire in shared mode. By default an exclusive lock |
144 | 144 |
will be acquired. |
145 |
blocking: whether to block while trying to acquire or to operate in try-lock mode.
|
|
146 |
this locking mode is not supported yet. |
|
145 |
blocking: whether to block while trying to acquire or to operate in |
|
146 |
try-lock mode. this locking mode is not supported yet.
|
|
147 | 147 |
|
148 | 148 |
""" |
149 | 149 |
if not blocking: |
... | ... | |
382 | 382 |
(special lock names, or instance/node names) |
383 | 383 |
shared: whether to acquire in shared mode. By default an exclusive lock |
384 | 384 |
will be acquired. |
385 |
blocking: whether to block while trying to acquire or to operate in try-lock mode.
|
|
386 |
this locking mode is not supported yet. |
|
385 |
blocking: whether to block while trying to acquire or to operate in |
|
386 |
try-lock mode. this locking mode is not supported yet.
|
|
387 | 387 |
|
388 | 388 |
Returns: |
389 | 389 |
True: when all the locks are successfully acquired |
... | ... | |
436 | 436 |
# just one of them be the already wrong |
437 | 437 |
for lname in names: |
438 | 438 |
try: |
439 |
lock = self.__lockdict[lname] # raises KeyError if the lock is not there
|
|
439 |
lock = self.__lockdict[lname] # raises KeyError if lock is not there |
|
440 | 440 |
acquire_list.append((lname, lock)) |
441 | 441 |
except (KeyError): |
442 | 442 |
if self.__lock._is_owned(): |
... | ... | |
685 | 685 |
def __init__(self, nodes=None, instances=None): |
686 | 686 |
"""Constructs a new GanetiLockManager object. |
687 | 687 |
|
688 |
There should be only a |
|
689 |
GanetiLockManager object at any time, so this function raises an error if this |
|
690 |
is not the case. |
|
688 |
There should be only a GanetiLockManager object at any time, so this |
|
689 |
function raises an error if this is not the case. |
|
691 | 690 |
|
692 | 691 |
Args: |
693 | 692 |
nodes: list of node names |
... | ... | |
762 | 761 |
(special lock names, or instance/node names) |
763 | 762 |
shared: whether to acquire in shared mode. By default an exclusive lock |
764 | 763 |
will be acquired. |
765 |
blocking: whether to block while trying to acquire or to operate in try-lock mode.
|
|
766 |
this locking mode is not supported yet. |
|
764 |
blocking: whether to block while trying to acquire or to operate in |
|
765 |
try-lock mode. this locking mode is not supported yet.
|
|
767 | 766 |
|
768 | 767 |
""" |
769 | 768 |
assert level in LEVELS, "Invalid locking level %s" % level |
Also available in: Unified diff