Revision cfdf561d lib/cmdlib.py

b/lib/cmdlib.py
14292 14292
  def ExpandNames(self):
14293 14293
    self.group_uuid = None
14294 14294
    self.needed_locks = {}
14295

  
14295 14296
    if self.op.kind == constants.TAG_NODE:
14296 14297
      self.op.name = _ExpandNodeName(self.cfg, self.op.name)
14297
      self.needed_locks[locking.LEVEL_NODE] = self.op.name
14298
      lock_level = locking.LEVEL_NODE
14299
      lock_name = self.op.name
14298 14300
    elif self.op.kind == constants.TAG_INSTANCE:
14299 14301
      self.op.name = _ExpandInstanceName(self.cfg, self.op.name)
14300
      self.needed_locks[locking.LEVEL_INSTANCE] = self.op.name
14302
      lock_level = locking.LEVEL_INSTANCE
14303
      lock_name = self.op.name
14301 14304
    elif self.op.kind == constants.TAG_NODEGROUP:
14302 14305
      self.group_uuid = self.cfg.LookupNodeGroup(self.op.name)
14306
      lock_level = locking.LEVEL_NODEGROUP
14307
      lock_name = self.group_uuid
14308
    else:
14309
      lock_level = None
14310
      lock_name = None
14311

  
14312
    if lock_level and getattr(self.op, "use_locking", True):
14313
      self.needed_locks[lock_level] = lock_name
14303 14314

  
14304 14315
    # FIXME: Acquire BGL for cluster tag operations (as of this writing it's
14305 14316
    # not possible to acquire the BGL based on opcode parameters)

Also available in: Unified diff