Commit 90b54c26 authored by Iustin Pop's avatar Iustin Pop
Browse files

Convert call_version rpc to new style result



This also cleans up its single use in cmdlib.py.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent e1e75d00
......@@ -574,7 +574,7 @@ class NodeHttpServer(http.server.HttpServer):
"""Query version information.
"""
return constants.PROTOCOL_VERSION
return True, constants.PROTOCOL_VERSION
@staticmethod
def perspective_upload_file(params):
......
......@@ -2287,17 +2287,17 @@ class LUAddNode(LogicalUnit):
# check connectivity
result = self.rpc.call_version([node])[node]
result.Raise()
if result.data:
if constants.PROTOCOL_VERSION == result.data:
logging.info("Communication to node %s fine, sw version %s match",
node, result.data)
else:
raise errors.OpExecError("Version mismatch master version %s,"
" node version %s" %
(constants.PROTOCOL_VERSION, result.data))
msg = result.RemoteFailMsg()
if msg:
raise errors.OpExecError("Can't get version information from"
" node %s: %s" % (node, msg))
if constants.PROTOCOL_VERSION == result.payload:
logging.info("Communication to node %s fine, sw version %s match",
node, result.payload)
else:
raise errors.OpExecError("Cannot get version from the new node")
raise errors.OpExecError("Version mismatch master version %s,"
" node version %s" %
(constants.PROTOCOL_VERSION, result.payload))
# setup ssh on node
logging.info("Copy ssh key to node %s", node)
......
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