Revision 4e7f986e lib/cmdlib/node.py

b/lib/cmdlib/node.py
486 486

  
487 487
    """
488 488
    return (instance.disk_template in constants.DTS_INT_MIRROR and
489
            self.op.node_uuid in instance.all_nodes)
489
            self.op.node_uuid in self.cfg.GetInstanceNodes(instance))
490 490

  
491 491
  def ExpandNames(self):
492 492
    if self.lock_all:
......
870 870

  
871 871
  """
872 872

  
873
  return _GetNodeInstancesInner(cfg, lambda inst: node_uuid in inst.all_nodes)
873
  return _GetNodeInstancesInner(cfg,
874
                                lambda inst: node_uuid in
875
                                  cfg.GetInstanceNodes(inst))
874 876

  
875 877

  
876 878
class LUNodeEvacuate(NoHooksLU):
......
1462 1464
                                 " node is required", errors.ECODE_INVAL)
1463 1465

  
1464 1466
    for _, instance in self.cfg.GetAllInstancesInfo().items():
1465
      if node.uuid in instance.all_nodes:
1467
      if node.uuid in self.cfg.GetInstanceNodes(instance):
1466 1468
        raise errors.OpPrereqError("Instance %s is still running on the node,"
1467 1469
                                   " please remove first" % instance.name,
1468 1470
                                   errors.ECODE_INVAL)
......
1563 1565
    for inst in _GetNodeInstances(self.cfg, self.op.node_uuid):
1564 1566
      if not inst.disks_active:
1565 1567
        continue
1566
      check_nodes = set(inst.all_nodes)
1568
      check_nodes = set(self.cfg.GetInstanceNodes(inst))
1567 1569
      check_nodes.discard(self.op.node_uuid)
1568 1570
      for inst_node_uuid in check_nodes:
1569 1571
        self._CheckFaultyDisks(inst, inst_node_uuid)

Also available in: Unified diff