result = self.rpc.call_upload_file(node_list,
constants.SSH_KNOWN_HOSTS_FILE)
for to_node, to_result in result.iteritems():
- if to_result.failed or not to_result.data:
- logging.error("Copy of file %s to node %s failed",
- constants.SSH_KNOWN_HOSTS_FILE, to_node)
+ msg = to_result.RemoteFailMsg()
+ if msg:
+ msg = ("Copy of file %s to node %s failed: %s" %
+ (constants.SSH_KNOWN_HOSTS_FILE, to_node, msg))
+ self.proc.LogWarning(msg)
finally:
result = self.rpc.call_node_start_master(master, False)
if os.path.exists(fname):
result = lu.rpc.call_upload_file(dist_nodes, fname)
for to_node, to_result in result.items():
- if to_result.failed or not to_result.data:
- logging.error("Copy of file %s to node %s failed", fname, to_node)
+ msg = to_result.RemoteFailMsg()
+ if msg:
+ msg = ("Copy of file %s to node %s failed: %s" %
+ (fname, to_node, msg))
+ lu.proc.LogWarning(msg)
class LURedistributeConfig(NoHooksLU):
" new node: %s" % msg)
# Add node to our /etc/hosts, and add key to known_hosts
- utils.AddHostToEtcHosts(new_node.name)
+ if self.cfg.GetClusterInfo().modify_etc_hosts:
+ utils.AddHostToEtcHosts(new_node.name)
if new_node.secondary_ip != new_node.primary_ip:
result = self.rpc.call_node_has_ip_address(new_node.name,
info("renaming the old LVs on the target node")
result = self.rpc.call_blockdev_rename(tgt_node, rlist)
- result.Raise()
- if not result.data:
- raise errors.OpExecError("Can't rename old LVs on node %s" % tgt_node)
+ msg = result.RemoteFailMsg()
+ if msg:
+ raise errors.OpExecError("Can't rename old LVs on node %s: %s" %
+ (tgt_node, msg))
# now we rename the new LVs to the old LVs
info("renaming the new LVs on the target node")
rlist = [(new, old.physical_id) for old, new in zip(old_lvs, new_lvs)]
result = self.rpc.call_blockdev_rename(tgt_node, rlist)
- result.Raise()
- if not result.data:
- raise errors.OpExecError("Can't rename new LVs on node %s" % tgt_node)
+ msg = result.RemoteFailMsg()
+ if msg:
+ raise errors.OpExecError("Can't rename new LVs on node %s: %s" %
+ (tgt_node, msg))
for old, new in zip(old_lvs, new_lvs):
new.logical_id = old.logical_id
# now that the new lvs have the old name, we can add them to the device
info("adding new mirror component on %s" % tgt_node)
result = self.rpc.call_blockdev_addchildren(tgt_node, dev, new_lvs)
- if result.failed or not result.data:
+ msg = result.RemoteFailMsg()
+ if msg:
for new_lv in new_lvs:
msg = self.rpc.call_blockdev_remove(tgt_node, new_lv).RemoteFailMsg()
if msg:
warning("Can't rollback device %s: %s", dev, msg,
hint="cleanup manually the unused logical volumes")
- raise errors.OpExecError("Can't add local storage to drbd")
+ raise errors.OpExecError("Can't add local storage to drbd: %s" % msg)
dev.children = new_lvs
cfg.Update(instance)