Revision 22b7f6f8 lib/cmdlib/common.py

b/lib/cmdlib/common.py
1002 1002
  for dev in instance.disks:
1003 1003
    cfg.SetDiskID(dev, node_name)
1004 1004

  
1005
  result = rpc_runner.call_blockdev_getmirrorstatus(node_name, (instance.disks,
1006
                                                                instance))
1005
  result = rpc_runner.call_blockdev_getmirrorstatus(node_name,
1006
                                                    (instance.disks,
1007
                                                     instance))
1007 1008
  result.Raise("Failed to get disk status from node %s" % node_name,
1008 1009
               prereq=prereq, ecode=errors.ECODE_ENVIRON)
1009 1010

  
......
1012 1013
      faulty.append(idx)
1013 1014

  
1014 1015
  return faulty
1016

  
1017

  
1018
def _CheckNodeOnline(lu, node, msg=None):
1019
  """Ensure that a given node is online.
1020

  
1021
  @param lu: the LU on behalf of which we make the check
1022
  @param node: the node to check
1023
  @param msg: if passed, should be a message to replace the default one
1024
  @raise errors.OpPrereqError: if the node is offline
1025

  
1026
  """
1027
  if msg is None:
1028
    msg = "Can't use offline node"
1029
  if lu.cfg.GetNodeInfo(node).offline:
1030
    raise errors.OpPrereqError("%s: %s" % (msg, node), errors.ECODE_STATE)

Also available in: Unified diff