bash_completion: Move common code into function
[ganeti-local] / qa / ganeti-qa.py
index 1bd4d5c..4c2a2fc 100755 (executable)
@@ -74,8 +74,9 @@ def SetupCluster():
   """Initializes the cluster.
 
   """
   """Initializes the cluster.
 
   """
-  RunTest(qa_cluster.TestClusterInit)
-  RunTest(qa_node.TestNodeAddAll)
+  if qa_config.TestEnabled('create-cluster'):
+    RunTest(qa_cluster.TestClusterInit)
+    RunTest(qa_node.TestNodeAddAll)
   if qa_config.TestEnabled('node-info'):
     RunTest(qa_node.TestNodeInfo)
 
   if qa_config.TestEnabled('node-info'):
     RunTest(qa_node.TestNodeInfo)
 
@@ -308,7 +309,8 @@ def main():
   finally:
     qa_config.ReleaseNode(pnode)
 
   finally:
     qa_config.ReleaseNode(pnode)
 
-  RunTest(qa_node.TestNodeRemoveAll)
+  if qa_config.TestEnabled('create-cluster'):
+    RunTest(qa_node.TestNodeRemoveAll)
 
   if qa_config.TestEnabled('cluster-destroy'):
     RunTest(qa_cluster.TestClusterDestroy)
 
   if qa_config.TestEnabled('cluster-destroy'):
     RunTest(qa_cluster.TestClusterDestroy)