Commit c2fc8250 authored by Iustin Pop's avatar Iustin Pop
Browse files

Convert node_has_ip_address rpc to new style



This should actually have a function in backend, but it's fine for now.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent aca13712
......@@ -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):
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment