diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 6ec61dc59757c047195c37e542fe32fa8ce1eea7..d9b1a44cbab72f8fd615cf48e198b2089f5aab45 100755 --- a/daemons/ganeti-noded +++ b/daemons/ganeti-noded @@ -493,7 +493,7 @@ class NodeHttpServer(http.server.HttpServer): """Checks if a node has the given ip address. """ - return utils.OwnIpAddress(params[0]) + return True, utils.OwnIpAddress(params[0]) @staticmethod def perspective_node_info(params): diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 1ca4528c1ef4d2e66f22f971aefd7ed569727d05..2d51ad255b9fcd796f0e170797f460fb4ce24fee 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2318,7 +2318,11 @@ class LUAddNode(LogicalUnit): if new_node.secondary_ip != new_node.primary_ip: result = self.rpc.call_node_has_ip_address(new_node.name, new_node.secondary_ip) - if result.failed or not result.data: + msg = result.RemoteFailMsg() + if msg: + raise errors.OpPrereqError("Failure checking secondary ip" + " on node %s: %s" % (new_node.name, msg)) + if not result.payload: raise errors.OpExecError("Node claims it doesn't have the secondary ip" " you gave (%s). Please fix and re-run this" " command." % new_node.secondary_ip)