Commit 102b115b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Forward-port changes made to readd in 1.2

qa_node.py: Fix typo in message
cmdlib.py: Don't add readded node to node list
ganeti-qa.py: Make sure readd isn't done for master node

Reviewed-by: iustinp
parent 4e713df6
......@@ -1862,7 +1862,9 @@ class LUAddNode(LogicalUnit):
# Distribute updated /etc/hosts and known_hosts to all nodes,
# including the node just added
myself = self.cfg.GetNodeInfo(self.sstore.GetMasterNode())
dist_nodes = self.cfg.GetNodeList() + [node]
dist_nodes = self.cfg.GetNodeList()
if not self.op.readd:
dist_nodes.append(node)
if myself.name in dist_nodes:
dist_nodes.remove(myself.name)
......
......@@ -258,14 +258,19 @@ def main():
if qa_config.TestEnabled('tags'):
RunTest(qa_tags.TestClusterTags)
if qa_config.TestEnabled('node-readd'):
master = qa_config.GetMasterNode()
pnode = qa_config.AcquireNode(exclude=master)
try:
RunTest(qa_node.TestNodeReadd, pnode)
finally:
qa_config.ReleaseNode(pnode)
pnode = qa_config.AcquireNode()
try:
if qa_config.TestEnabled('tags'):
RunTest(qa_tags.TestNodeTags, pnode)
if qa_config.TestEnabled('node-readd'):
RunTest(qa_node.TestNodeReadd, pnode)
if qa_config.TestEnabled('instance-add-plain-disk'):
instance = RunTest(qa_instance.TestInstanceAddWithPlainDisk, pnode)
RunCommonInstanceTests(instance)
......
......@@ -35,7 +35,7 @@ def _NodeAdd(node, readd=False):
if not readd and node.get('_added', False):
raise qa_error.Error("Node %s already in cluster" % node['primary'])
elif readd and not node.get('_added', False):
raise qa_error.Error("Node not yet %s in cluster" % node['primary'])
raise qa_error.Error("Node %s not yet in cluster" % node['primary'])
cmd = ['gnt-node', 'add']
if node.get('secondary', None):
......
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