QA: Split function to set and parse instance policies
[ganeti-local] / qa / qa_tags.py
index 9e48696..834f7a8 100644 (file)
@@ -1,3 +1,6 @@
+#
+#
+
 # Copyright (C) 2007 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -34,6 +37,7 @@ _KIND_TO_COMMAND = {
   constants.TAG_CLUSTER: "gnt-cluster",
   constants.TAG_NODE: "gnt-node",
   constants.TAG_INSTANCE: "gnt-instance",
+  constants.TAG_NODEGROUP: "gnt-group",
   }
 
 
@@ -68,9 +72,14 @@ def TestClusterTags():
 
 def TestNodeTags(node):
   """gnt-node tags"""
-  _TestTags(constants.TAG_NODE, node["primary"])
+  _TestTags(constants.TAG_NODE, node.primary)
+
+
+def TestGroupTags(group):
+  """gnt-group tags"""
+  _TestTags(constants.TAG_NODEGROUP, group)
 
 
 def TestInstanceTags(instance):
   """gnt-instance tags"""
-  _TestTags(constants.TAG_INSTANCE, instance["name"])
+  _TestTags(constants.TAG_INSTANCE, instance.name)