now accepts nodegroup_id or name (previously only accepted nodegroup_id)
authorTony Mack <tmack@cs.princeton.edu>
Wed, 13 Sep 2006 16:32:23 +0000 (16:32 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 13 Sep 2006 16:32:23 +0000 (16:32 +0000)
PLC/Methods/AdmDeleteNodeGroup.py

index d780e59..cadc32e 100644 (file)
@@ -18,14 +18,15 @@ class AdmDeleteNodeGroup(Method):
 
     accepts = [
         PasswordAuth(),
-        NodeGroup.fields['nodegroup_id'],
+        Mixed(NodeGroup.fields['nodegroup_id'],
+             NodeGroup.fields['name'])
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    def call(self, auth, node_group_id):
+    def call(self, auth, node_group_id_or_name):
         # Get account information
-        nodegroups = NodeGroups(self.api, [node_group_id])
+        nodegroups = NodeGroups(self.api, [node_group_id_or_name])
         if not nodegroups:
             raise PLCInvalidArgument, "No such node group"