LockSet: make acquire() return the set of names
authorGuido Trotter <ultrotter@google.com>
Tue, 4 Mar 2008 13:17:09 +0000 (13:17 +0000)
committerGuido Trotter <ultrotter@google.com>
Tue, 4 Mar 2008 13:17:09 +0000 (13:17 +0000)
commit0cc009290d02ca37258258edc2c4c0274be03dd8
treeafad1bc82e55dcd55c760ad6f56a14c4df9b955f
parent8b68f39465f4b64e44ac0753321d8e46558fa52a
LockSet: make acquire() return the set of names

In a LockSet acquire() returned True on success. This code changes that to
return a set containing the names of the elements acquired. This is still a
true value if we acquired any lock but is slightly more useful (because if
needed one has access to this data without querying for it). The only change
happens if acquiring no locks, which though is a usage which should not
normally happen because it has no practical use.

The patch also changes a some tests to check that the new format is respected.

Reviewed-by: imsnah
lib/locking.py
test/ganeti.locking_unittest.py