Revision c7dd65be lib/cmdlib/instance.py

b/lib/cmdlib/instance.py
1390 1390
        result = self.rpc.call_instance_run_rename(pnode_name, iobj,
1391 1391
                                                   rename_from,
1392 1392
                                                   self.op.debug_level)
1393
        if result.fail_msg:
1394
          self.LogWarning("Failed to run rename script for %s on node"
1395
                          " %s: %s" % (instance, pnode_name, result.fail_msg))
1393
        result.Warn("Failed to run rename script for %s on node %s" %
1394
                    (instance, pnode_name), self.LogWarning)
1396 1395

  
1397 1396
    assert not self.owned_locks(locking.LEVEL_NODE_RES)
1398 1397

  
......
1512 1511
      for node in inst.all_nodes:
1513 1512
        self.cfg.SetDiskID(disk, node)
1514 1513
        result = self.rpc.call_blockdev_setinfo(node, disk, info)
1515
        if result.fail_msg:
1516
          self.LogWarning("Error setting info on node %s for disk %s: %s",
1517
                          node, idx, result.fail_msg)
1514
        result.Warn("Error setting info on node %s for disk %s" % (node, idx),
1515
                    self.LogWarning)
1518 1516
    try:
1519 1517
      result = self.rpc.call_instance_run_rename(inst.primary_node, inst,
1520 1518
                                                 old_name, self.op.debug_level)
1521
      msg = result.fail_msg
1522
      if msg:
1523
        msg = ("Could not run OS rename script for instance %s on node %s"
1524
               " (but the instance has been renamed in Ganeti): %s" %
1525
               (inst.name, inst.primary_node, msg))
1526
        self.LogWarning(msg)
1519
      result.Warn("Could not run OS rename script for instance %s on node %s"
1520
                  " (but the instance has been renamed in Ganeti)" %
1521
                  (inst.name, inst.primary_node), self.LogWarning)
1527 1522
    finally:
1528 1523
      ShutdownInstanceDisks(self, inst)
1529 1524

  
......
1591 1586
    result = self.rpc.call_instance_shutdown(instance.primary_node, instance,
1592 1587
                                             self.op.shutdown_timeout,
1593 1588
                                             self.op.reason)
1594
    msg = result.fail_msg
1595
    if msg:
1596
      if self.op.ignore_failures:
1597
        feedback_fn("Warning: can't shutdown instance: %s" % msg)
1598
      else:
1599
        raise errors.OpExecError("Could not shutdown instance %s on"
1600
                                 " node %s: %s" %
1601
                                 (instance.name, instance.primary_node, msg))
1589
    if self.op.ignore_failures:
1590
      result.Warn("Warning: can't shutdown instance", feedback_fn)
1591
    else:
1592
      result.Raise("Could not shutdown instance %s on node %s" %
1593
                   (instance.name, instance.primary_node))
1602 1594

  
1603 1595
    assert (self.owned_locks(locking.LEVEL_NODE) ==
1604 1596
            self.owned_locks(locking.LEVEL_NODE_RES))
......
1732 1724
    result = self.rpc.call_instance_shutdown(source_node, instance,
1733 1725
                                             self.op.shutdown_timeout,
1734 1726
                                             self.op.reason)
1735
    msg = result.fail_msg
1736
    if msg:
1737
      if self.op.ignore_consistency:
1738
        self.LogWarning("Could not shutdown instance %s on node %s."
1739
                        " Proceeding anyway. Please make sure node"
1740
                        " %s is down. Error details: %s",
1741
                        instance.name, source_node, source_node, msg)
1742
      else:
1743
        raise errors.OpExecError("Could not shutdown instance %s on"
1744
                                 " node %s: %s" %
1745
                                 (instance.name, source_node, msg))
1727
    if self.op.ignore_consistency:
1728
      result.Warn("Could not shutdown instance %s on node %s. Proceeding"
1729
                  " anyway. Please make sure node %s is down. Error details" %
1730
                  (instance.name, source_node, source_node), self.LogWarning)
1731
    else:
1732
      result.Raise("Could not shutdown instance %s on node %s" %
1733
                   (instance.name, source_node))
1746 1734

  
1747 1735
    # create the target disks
1748 1736
    try:

Also available in: Unified diff