merge from head - 1.21
[plcapi.git] / PLC / Methods / AdmGetNodeGroupNodes.py
index a040685..857e1b5 100644 (file)
@@ -1,7 +1,7 @@
 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):
@@ -13,10 +13,12 @@ class AdmGetNodeGroupNodes(Method):
 
     status = "deprecated"
 
+    object_type = 'Node'
+
     roles = ['admin', 'pi', 'user', 'tech']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         Mixed(NodeGroup.fields['nodegroup_id'],
              NodeGroup.fields['name'])
         ]
@@ -30,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']