Revision 819ca990 lib/locking.py

b/lib/locking.py
1283 1283
#   the same time.
1284 1284
LEVEL_CLUSTER = 0
1285 1285
LEVEL_INSTANCE = 1
1286
LEVEL_NODE = 2
1286
LEVEL_NODEGROUP = 2
1287
LEVEL_NODE = 3
1287 1288

  
1288 1289
LEVELS = [LEVEL_CLUSTER,
1289 1290
          LEVEL_INSTANCE,
1291
          LEVEL_NODEGROUP,
1290 1292
          LEVEL_NODE]
1291 1293

  
1292 1294
# Lock levels which are modifiable
1293
LEVELS_MOD = [LEVEL_NODE, LEVEL_INSTANCE]
1295
LEVELS_MOD = [LEVEL_NODE, LEVEL_NODEGROUP, LEVEL_INSTANCE]
1294 1296

  
1295 1297
LEVEL_NAMES = {
1296 1298
  LEVEL_CLUSTER: "cluster",
1297 1299
  LEVEL_INSTANCE: "instance",
1300
  LEVEL_NODEGROUP: "nodegroup",
1298 1301
  LEVEL_NODE: "node",
1299 1302
  }
1300 1303

  
......
1313 1316
  """
1314 1317
  _instance = None
1315 1318

  
1316
  def __init__(self, nodes, instances):
1319
  def __init__(self, nodes, nodegroups, instances):
1317 1320
    """Constructs a new GanetiLockManager object.
1318 1321

  
1319 1322
    There should be only a GanetiLockManager object at any time, so this
1320 1323
    function raises an error if this is not the case.
1321 1324

  
1322 1325
    @param nodes: list of node names
1326
    @param nodegroups: list of nodegroup uuids
1323 1327
    @param instances: list of instance names
1324 1328

  
1325 1329
    """
......
1335 1339
    self.__keyring = {
1336 1340
      LEVEL_CLUSTER: LockSet([BGL], "BGL", monitor=self._monitor),
1337 1341
      LEVEL_NODE: LockSet(nodes, "nodes", monitor=self._monitor),
1342
      LEVEL_NODEGROUP: LockSet(nodegroups, "nodegroups", monitor=self._monitor),
1338 1343
      LEVEL_INSTANCE: LockSet(instances, "instances",
1339 1344
                              monitor=self._monitor),
1340 1345
      }

Also available in: Unified diff