This commit was manufactured by cvs2svn to create branch
[plcapi.git] / PLC / Methods / AdmGetNodeGroups.py
index 6d45c20..fa1ad59 100644 (file)
@@ -1,34 +1,8 @@
-from PLC.Faults import *
-from PLC.Method import Method
-from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
-from PLC.NodeGroups import NodeGroup, NodeGroups
+from PLC.Methods.GetNodeGroups import GetNodeGroups
 
-class AdmGetNodeGroups(Method):
+class AdmGetNodeGroups(GetNodeGroups):
     """
-    Returns an array of structs containing details about all node
-    groups. If nodegroup_id_or_name_list is specified, only the
-    specified node groups will be queried.
+    Deprecated. See GetNodeGroups.
     """
 
-    roles = ['admin', 'pi', 'user', 'tech']
-
-    accepts = [
-        PasswordAuth(),
-        [Mixed(NodeGroup.fields['nodegroup_id'],
-              NodeGroup.fields['name'])]
-        ]
-
-    returns = [NodeGroup.all_fields]
-  
-    def call(self, auth, nodegroup_id_or_name_list = None):
-        # Get node group details
-       nodegroups = NodeGroups(self.api, nodegroup_id_or_name_list).values()
-
-       # Filter out undesired or None fields (XML-RPC cannot marshal
-        # None) and turn each nodegroup into a real dict.
-        valid_return_fields_only = lambda (key, value): value is not None
-        nodegroups = [dict(filter(valid_return_fields_only, nodegroup.items())) \
-                      for nodegroup in nodegroups]
-
-        return nodegroups
+    status = "deprecated"