When not initialising the cluster, consider all nodes are added, so that
multi-node tests (e.g. export, replace) work correctly (if there are
nodes, of course).
---
 qa/ganeti-qa.py |    3 +++
 qa/qa_node.py   |   12 ++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py
index d66d8c3..5c399e7 100755
--- a/qa/ganeti-qa.py
+++ b/qa/ganeti-qa.py
@@ -77,6 +77,9 @@ def SetupCluster():
   if qa_config.TestEnabled('create-cluster'):
     RunTest(qa_cluster.TestClusterInit)
     RunTest(qa_node.TestNodeAddAll)
+  else:
+    # consider the nodes are already there
+    qa_node.MarkNodeAddedAll()
   if qa_config.TestEnabled('node-info'):
     RunTest(qa_node.TestNodeInfo)
 
diff --git a/qa/qa_node.py b/qa/qa_node.py
index 8d17a4c..025683c 100644
--- a/qa/qa_node.py
+++ b/qa/qa_node.py
@@ -66,6 +66,18 @@ def TestNodeAddAll():
       _NodeAdd(node, readd=False)
 
 
+def MarkNodeAddedAll():
+  """Mark all nodes as added.
+
+  This is useful if we don't create the cluster ourselves (in qa).
+
+  """
+  master = qa_config.GetMasterNode()
+  for node in qa_config.get('nodes'):
+    if node != master:
+      node['_added'] = True
+
+
 def TestNodeRemoveAll():
   """Removing all nodes from cluster."""
   master = qa_config.GetMasterNode()
-- 
1.6.5.3

Reply via email to