Revision c772d142 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
80 | 80 |
# Dicts used to declare locking needs to mcpu |
81 | 81 |
self.needed_locks = None |
82 | 82 |
self.acquired_locks = {} |
83 |
self.share_locks = dict(((i, 0) for i in locking.LEVELS))
|
|
83 |
self.share_locks = dict.fromkeys(locking.LEVELS, 0)
|
|
84 | 84 |
self.add_locks = {} |
85 | 85 |
self.remove_locks = {} |
86 | 86 |
# Used to force good behavior when calling helper functions |
... | ... | |
695 | 695 |
locking.LEVEL_NODE: locking.ALL_SET, |
696 | 696 |
locking.LEVEL_INSTANCE: locking.ALL_SET, |
697 | 697 |
} |
698 |
self.share_locks = dict(((i, 1) for i in locking.LEVELS))
|
|
698 |
self.share_locks = dict.fromkeys(locking.LEVELS, 1)
|
|
699 | 699 |
|
700 | 700 |
def _VerifyNode(self, nodeinfo, file_list, local_cksum, |
701 | 701 |
node_result, feedback_fn, master_files, |
... | ... | |
1294 | 1294 |
locking.LEVEL_NODE: locking.ALL_SET, |
1295 | 1295 |
locking.LEVEL_INSTANCE: locking.ALL_SET, |
1296 | 1296 |
} |
1297 |
self.share_locks = dict(((i, 1) for i in locking.LEVELS))
|
|
1297 |
self.share_locks = dict.fromkeys(locking.LEVELS, 1)
|
|
1298 | 1298 |
|
1299 | 1299 |
def CheckPrereq(self): |
1300 | 1300 |
"""Check prerequisites. |
... | ... | |
5760 | 5760 |
|
5761 | 5761 |
def ExpandNames(self): |
5762 | 5762 |
self.needed_locks = {} |
5763 |
self.share_locks = dict(((i, 1) for i in locking.LEVELS))
|
|
5763 |
self.share_locks = dict.fromkeys(locking.LEVELS, 1)
|
|
5764 | 5764 |
|
5765 | 5765 |
if not isinstance(self.op.instances, list): |
5766 | 5766 |
raise errors.OpPrereqError("Invalid argument type 'instances'") |
Also available in: Unified diff