Revision 2d453213
b/lib/cmdlib.py | ||
---|---|---|
5033 | 5033 |
if self.op.ndparams: |
5034 | 5034 |
utils.ForceDictType(self.op.ndparams, constants.NDS_PARAMETER_TYPES) |
5035 | 5035 |
|
5036 |
# check connectivity |
|
5037 |
result = self.rpc.call_version([self.new_node.name])[self.new_node.name] |
|
5038 |
result.Raise("Can't get version information from node %s" % node) |
|
5039 |
if constants.PROTOCOL_VERSION == result.payload: |
|
5040 |
logging.info("Communication to node %s fine, sw version %s match", |
|
5041 |
node, result.payload) |
|
5042 |
else: |
|
5043 |
raise errors.OpPrereqError("Version mismatch master version %s," |
|
5044 |
" node version %s" % |
|
5045 |
(constants.PROTOCOL_VERSION, result.payload), |
|
5046 |
errors.ECODE_ENVIRON) |
|
5047 |
|
|
5036 | 5048 |
def Exec(self, feedback_fn): |
5037 | 5049 |
"""Adds the new node to the cluster. |
5038 | 5050 |
|
... | ... | |
5068 | 5080 |
else: |
5069 | 5081 |
new_node.ndparams = {} |
5070 | 5082 |
|
5071 |
# check connectivity |
|
5072 |
result = self.rpc.call_version([node])[node] |
|
5073 |
result.Raise("Can't get version information from node %s" % node) |
|
5074 |
if constants.PROTOCOL_VERSION == result.payload: |
|
5075 |
logging.info("Communication to node %s fine, sw version %s match", |
|
5076 |
node, result.payload) |
|
5077 |
else: |
|
5078 |
raise errors.OpExecError("Version mismatch master version %s," |
|
5079 |
" node version %s" % |
|
5080 |
(constants.PROTOCOL_VERSION, result.payload)) |
|
5081 |
|
|
5082 | 5083 |
# Add node to our /etc/hosts, and add key to known_hosts |
5083 | 5084 |
if self.cfg.GetClusterInfo().modify_etc_hosts: |
5084 | 5085 |
master_node = self.cfg.GetMasterNode() |
Also available in: Unified diff