Skip to content
Snippets Groups Projects
Commit 8ccecf10 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

LUNodeAdd: Make the version call only dependend on DNS


Also move the version check into prereq to abort before alter cluster
state if the version mismatch.

Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent bd6d1202
No related branches found
No related tags found
No related merge requests found
...@@ -5589,6 +5589,19 @@ class LUNodeAdd(LogicalUnit): ...@@ -5589,6 +5589,19 @@ class LUNodeAdd(LogicalUnit):
if self.op.disk_state: if self.op.disk_state:
self.new_disk_state = _MergeAndVerifyDiskState(self.op.disk_state, None) self.new_disk_state = _MergeAndVerifyDiskState(self.op.disk_state, None)
   
# TODO: If we need to have multiple DnsOnlyRunner we probably should make
# it a property on the base class.
result = rpc.DnsOnlyRunner().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.OpPrereqError("Version mismatch master version %s,"
" node version %s" %
(constants.PROTOCOL_VERSION, result.payload),
errors.ECODE_ENVIRON)
def Exec(self, feedback_fn): def Exec(self, feedback_fn):
"""Adds the new node to the cluster. """Adds the new node to the cluster.
   
...@@ -5633,17 +5646,6 @@ class LUNodeAdd(LogicalUnit): ...@@ -5633,17 +5646,6 @@ class LUNodeAdd(LogicalUnit):
if self.op.disk_state: if self.op.disk_state:
new_node.disk_state_static = self.new_disk_state new_node.disk_state_static = self.new_disk_state
   
# 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 # Add node to our /etc/hosts, and add key to known_hosts
if self.cfg.GetClusterInfo().modify_etc_hosts: if self.cfg.GetClusterInfo().modify_etc_hosts:
master_node = self.cfg.GetMasterNode() master_node = self.cfg.GetMasterNode()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment