Revision da4a52a3 lib/locking.py
b/lib/locking.py | ||
---|---|---|
1636 | 1636 |
""" |
1637 | 1637 |
_instance = None |
1638 | 1638 |
|
1639 |
def __init__(self, nodes, nodegroups, instances, networks):
|
|
1639 |
def __init__(self, node_uuids, nodegroups, instance_names, networks):
|
|
1640 | 1640 |
"""Constructs a new GanetiLockManager object. |
1641 | 1641 |
|
1642 | 1642 |
There should be only a GanetiLockManager object at any time, so this |
1643 | 1643 |
function raises an error if this is not the case. |
1644 | 1644 |
|
1645 |
@param nodes: list of node names
|
|
1645 |
@param node_uuids: list of node UUIDs
|
|
1646 | 1646 |
@param nodegroups: list of nodegroup uuids |
1647 |
@param instances: list of instance names |
|
1647 |
@param instance_names: list of instance names
|
|
1648 | 1648 |
|
1649 | 1649 |
""" |
1650 | 1650 |
assert self.__class__._instance is None, \ |
... | ... | |
1658 | 1658 |
# locking order. |
1659 | 1659 |
self.__keyring = { |
1660 | 1660 |
LEVEL_CLUSTER: LockSet([BGL], "cluster", monitor=self._monitor), |
1661 |
LEVEL_NODE: LockSet(nodes, "node", monitor=self._monitor), |
|
1662 |
LEVEL_NODE_RES: LockSet(nodes, "node-res", monitor=self._monitor), |
|
1661 |
LEVEL_NODE: LockSet(node_uuids, "node", monitor=self._monitor),
|
|
1662 |
LEVEL_NODE_RES: LockSet(node_uuids, "node-res", monitor=self._monitor),
|
|
1663 | 1663 |
LEVEL_NODEGROUP: LockSet(nodegroups, "nodegroup", monitor=self._monitor), |
1664 |
LEVEL_INSTANCE: LockSet(instances, "instance", monitor=self._monitor), |
|
1664 |
LEVEL_INSTANCE: LockSet(instance_names, "instance", |
|
1665 |
monitor=self._monitor), |
|
1665 | 1666 |
LEVEL_NETWORK: LockSet(networks, "network", monitor=self._monitor), |
1666 | 1667 |
LEVEL_NODE_ALLOC: LockSet([NAL], "node-alloc", monitor=self._monitor), |
1667 | 1668 |
} |
Also available in: Unified diff