- added logging variable 'object_type'
[plcapi.git] / PLC / Methods / AdmGetNodeGroupNodes.py
index a82ed56..857e1b5 100644 (file)
@@ -1,23 +1,29 @@
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
 from PLC.NodeGroups import NodeGroup, NodeGroups
 
 class AdmGetNodeGroupNodes(Method):
     """
+    Deprecated. See GetNodeGroups.
+
     Returns a list of node_ids for the node group specified.
     """
 
+    status = "deprecated"
+
+    object_type = 'Node'
+
     roles = ['admin', 'pi', 'user', 'tech']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         Mixed(NodeGroup.fields['nodegroup_id'],
              NodeGroup.fields['name'])
         ]
 
-    returns = NodeGroup.join_fields['node_ids']
+    returns = NodeGroup.fields['node_ids']
 
     def call(self, auth, nodegroup_id_or_name):
         # Get nodes in this nodegroup
@@ -26,7 +32,7 @@ class AdmGetNodeGroupNodes(Method):
             raise PLCInvalidArgument, "No such node group"
 
        # Get the info for the node group specified
-       nodegroup = nodegroups.values()[0]
+       nodegroup = nodegroups[0]
 
        # Return the list of node_ids
         return nodegroup['node_ids']