Temporary fix for hspace's NPU calculation
[ganeti-local] / qa / qa_group.py
index 38a9d7a..e09c2f8 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2010 Google Inc.
+# Copyright (C) 2010, 2011 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # 02110-1301, USA.
 
 
+"""QA tests for node groups.
+
+"""
+
 from ganeti import constants
 from ganeti import query
 from ganeti import utils
@@ -29,12 +33,20 @@ import qa_utils
 from qa_utils import AssertCommand, AssertEqual, GetCommandOutput
 
 
+def GetDefaultGroup():
+  """Returns the default node group.
+
+  """
+  groups = qa_config.get("groups", {})
+  return groups.get("group-with-nodes", constants.INITIAL_NODE_GROUP_NAME)
+
+
 def TestGroupAddRemoveRename():
   """gnt-group add/remove/rename"""
   groups = qa_config.get("groups", {})
 
-  existing_group_with_nodes = groups.get("group-with-nodes",
-                                         constants.INITIAL_NODE_GROUP_NAME)
+  existing_group_with_nodes = GetDefaultGroup()
+
   group1, group2, group3 = groups.get("inexistent-groups",
                                       ["group1", "group2", "group3"])[:3]