Revision 6683bba2 lib/cmdlib.py

b/lib/cmdlib.py
81 81
    self.sstore = sstore
82 82
    self.context = context
83 83
    self.needed_locks = None
84
    self.acquired_locks = {}
84 85
    self.share_locks = dict(((i, 0) for i in locking.LEVELS))
85 86
    # Used to force good behavior when calling helper functions
86 87
    self.recalculate_locks = {}
......
291 292
    # future we might want to have different behaviors depending on the value
292 293
    # of self.recalculate_locks[locking.LEVEL_NODE]
293 294
    wanted_nodes = []
294
    for instance_name in self.needed_locks[locking.LEVEL_INSTANCE]:
295
    for instance_name in self.acquired_locks[locking.LEVEL_INSTANCE]:
295 296
      instance = self.context.cfg.GetInstanceInfo(instance_name)
296 297
      wanted_nodes.append(instance.primary_node)
297 298
      wanted_nodes.extend(instance.secondary_nodes)
......
1398 1399

  
1399 1400
    """
1400 1401
    # This of course is valid only if we locked the nodes
1401
    self.wanted = self.needed_locks[locking.LEVEL_NODE]
1402
    self.wanted = self.acquired_locks[locking.LEVEL_NODE]
1402 1403

  
1403 1404
  def Exec(self, feedback_fn):
1404 1405
    """Computes the list of nodes and their attributes.
......
2501 2502

  
2502 2503
    """
2503 2504
    # This of course is valid only if we locked the instances
2504
    self.wanted = self.needed_locks[locking.LEVEL_INSTANCE]
2505
    self.wanted = self.acquired_locks[locking.LEVEL_INSTANCE]
2505 2506

  
2506 2507
  def Exec(self, feedback_fn):
2507 2508
    """Computes the list of nodes and their attributes.

Also available in: Unified diff