Revision e2ea8de1 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
5080 | 5080 |
if self.op.ndparams: |
5081 | 5081 |
utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES) |
5082 | 5082 |
|
5083 |
# check connectivity |
|
5084 |
result = self.rpc.call_version([self.new_node.name])[self.new_node.name] |
|
5085 |
result.Raise("Can't get version information from node %s" % node) |
|
5086 |
if constants.PROTOCOL_VERSION == result.payload: |
|
5087 |
logging.info("Communication to node %s fine, sw version %s match", |
|
5088 |
node, result.payload) |
|
5089 |
else: |
|
5090 |
raise errors.OpPrereqError("Version mismatch master version %s," |
|
5091 |
" node version %s" % |
|
5092 |
(constants.PROTOCOL_VERSION, result.payload), |
|
5093 |
errors.ECODE_ENVIRON) |
|
5094 |
|
|
5083 | 5095 |
def Exec(self, feedback_fn): |
5084 | 5096 |
"""Adds the new node to the cluster. |
5085 | 5097 |
|
... | ... | |
5115 | 5127 |
else: |
5116 | 5128 |
new_node.ndparams = {} |
5117 | 5129 |
|
5118 |
# check connectivity |
|
5119 |
result = self.rpc.call_version([node])[node] |
|
5120 |
result.Raise("Can't get version information from node %s" % node) |
|
5121 |
if constants.PROTOCOL_VERSION == result.payload: |
|
5122 |
logging.info("Communication to node %s fine, sw version %s match", |
|
5123 |
node, result.payload) |
|
5124 |
else: |
|
5125 |
raise errors.OpExecError("Version mismatch master version %s," |
|
5126 |
" node version %s" % |
|
5127 |
(constants.PROTOCOL_VERSION, result.payload)) |
|
5128 |
|
|
5129 | 5130 |
# Add node to our /etc/hosts, and add key to known_hosts |
5130 | 5131 |
if self.cfg.GetClusterInfo().modify_etc_hosts: |
5131 | 5132 |
master_node = self.cfg.GetMasterNode() |
Also available in: Unified diff