Revision 1fae010f lib/cmdlib.py

b/lib/cmdlib.py
2796 2796
      if msg:
2797 2797
        raise errors.OpExecError("Could not reboot instance: %s" % msg)
2798 2798
    else:
2799
      if not self.rpc.call_instance_shutdown(node_current, instance):
2800
        raise errors.OpExecError("could not shutdown instance for full reboot")
2799
      result = self.rpc.call_instance_shutdown(node_current, instance)
2800
      msg = result.RemoteFailMsg()
2801
      if msg:
2802
        raise errors.OpExecError("Could not shutdown instance for"
2803
                                 " full reboot: %s" % msg)
2801 2804
      _ShutdownInstanceDisks(self, instance)
2802 2805
      _StartInstanceDisks(self, instance, ignore_secondaries)
2803 2806
      result = self.rpc.call_instance_start(node_current, instance, extra_args)
......
2851 2854
    node_current = instance.primary_node
2852 2855
    self.cfg.MarkInstanceDown(instance.name)
2853 2856
    result = self.rpc.call_instance_shutdown(node_current, instance)
2854
    if result.failed or not result.data:
2855
      self.proc.LogWarning("Could not shutdown instance")
2857
    msg = result.RemoteFailMsg()
2858
    if msg:
2859
      self.proc.LogWarning("Could not shutdown instance: %s" % msg)
2856 2860

  
2857 2861
    _ShutdownInstanceDisks(self, instance)
2858 2862

  
......
3102 3106
                 instance.name, instance.primary_node)
3103 3107

  
3104 3108
    result = self.rpc.call_instance_shutdown(instance.primary_node, instance)
3105
    if result.failed or not result.data:
3109
    msg = result.RemoteFailMsg()
3110
    if msg:
3106 3111
      if self.op.ignore_failures:
3107
        feedback_fn("Warning: can't shutdown instance")
3112
        feedback_fn("Warning: can't shutdown instance: %s" % msg)
3108 3113
      else:
3109
        raise errors.OpExecError("Could not shutdown instance %s on node %s" %
3110
                                 (instance.name, instance.primary_node))
3114
        raise errors.OpExecError("Could not shutdown instance %s on"
3115
                                 " node %s: %s" %
3116
                                 (instance.name, instance.primary_node, msg))
3111 3117

  
3112 3118
    logging.info("Removing block devices for instance %s", instance.name)
3113 3119

  
......
3454 3460
                 instance.name, source_node)
3455 3461

  
3456 3462
    result = self.rpc.call_instance_shutdown(source_node, instance)
3457
    if result.failed or not result.data:
3463
    msg = result.RemoteFailMsg()
3464
    if msg:
3458 3465
      if self.op.ignore_consistency:
3459 3466
        self.proc.LogWarning("Could not shutdown instance %s on node %s."
3460
                             " Proceeding"
3461
                             " anyway. Please make sure node %s is down",
3462
                             instance.name, source_node, source_node)
3467
                             " Proceeding anyway. Please make sure node"
3468
                             " %s is down. Error details: %s",
3469
                             instance.name, source_node, source_node, msg)
3463 3470
      else:
3464
        raise errors.OpExecError("Could not shutdown instance %s on node %s" %
3465
                                 (instance.name, source_node))
3471
        raise errors.OpExecError("Could not shutdown instance %s on"
3472
                                 " node %s: %s" %
3473
                                 (instance.name, source_node, msg))
3466 3474

  
3467 3475
    feedback_fn("* deactivating the instance's disks on source node")
3468 3476
    if not _ShutdownInstanceDisks(self, instance, ignore_primary=True):
......
6083 6091
    if self.op.shutdown:
6084 6092
      # shutdown the instance, but not the disks
6085 6093
      result = self.rpc.call_instance_shutdown(src_node, instance)
6086
      result.Raise()
6087
      if not result.data:
6088
        raise errors.OpExecError("Could not shutdown instance %s on node %s" %
6089
                                 (instance.name, src_node))
6094
      msg = result.RemoteFailMsg()
6095
      if msg:
6096
        raise errors.OpExecError("Could not shutdown instance %s on"
6097
                                 " node %s: %s" %
6098
                                 (instance.name, src_node, msg))
6090 6099

  
6091 6100
    vgname = self.cfg.GetVGName()
6092 6101

  

Also available in: Unified diff