Commit 2d453213 authored by René Nussbaumer's avatar René Nussbaumer Committed by Michael Hanselmann
Browse files

LUNodeAdd: Verify version in Prereq



There are other ways to leave the cluster in a broken state than just
the version check. However they are not very trivial to fix in 2.5. So
leave it up to 2.6 for a nicer fix.
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
(cherry picked from commit e2ea8de1)
parent 0304f0ec
......@@ -5033,6 +5033,18 @@ class LUNodeAdd(LogicalUnit):
if self.op.ndparams:
utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES)
# check connectivity
result = self.rpc.call_version([self.new_node.name])[self.new_node.name]
result.Raise("Can't get version information from node %s" % node)
if constants.PROTOCOL_VERSION == result.payload:
logging.info("Communication to node %s fine, sw version %s match",
node, result.payload)
else:
raise errors.OpPrereqError("Version mismatch master version %s,"
" node version %s" %
(constants.PROTOCOL_VERSION, result.payload),
errors.ECODE_ENVIRON)
def Exec(self, feedback_fn):
"""Adds the new node to the cluster.
......@@ -5068,17 +5080,6 @@ class LUNodeAdd(LogicalUnit):
else:
new_node.ndparams = {}
# check connectivity
result = self.rpc.call_version([node])[node]
result.Raise("Can't get version information from node %s" % node)
if constants.PROTOCOL_VERSION == result.payload:
logging.info("Communication to node %s fine, sw version %s match",
node, result.payload)
else:
raise errors.OpExecError("Version mismatch master version %s,"
" node version %s" %
(constants.PROTOCOL_VERSION, result.payload))
# Add node to our /etc/hosts, and add key to known_hosts
if self.cfg.GetClusterInfo().modify_etc_hosts:
master_node = self.cfg.GetMasterNode()
......
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