- fix documentation for return value
authorMark Huang <mlhuang@cs.princeton.edu>
Tue, 19 Sep 2006 19:05:49 +0000 (19:05 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Tue, 19 Sep 2006 19:05:49 +0000 (19:05 +0000)
- remove redundant roles check

PLC/Methods/AdmAddNodeGroup.py

index 77d1ba5..3468cf1 100644 (file)
@@ -12,7 +12,7 @@ class AdmAddNodeGroup(Method):
     Adds a new node group. Any values specified in optional_vals are used,
     otherwise defaults are used.
 
-    Returns the new node_id (> 0) if successful, faults otherwise.
+    Returns the new nodegroup_id (> 0) if successful, faults otherwise.
     """
 
     roles = ['admin']
@@ -28,20 +28,13 @@ class AdmAddNodeGroup(Method):
         update_fields
         ]
 
-    returns = Parameter(int, '1 if successful')
+    returns = Parameter(int, 'New nodegroup_id (> 0) if successful')
 
     def call(self, auth, name, description, optional_vals = {}):
         if filter(lambda field: field not in self.update_fields, optional_vals):
             raise PLCInvalidArgument, "Invalid fields specified"
 
-        # Authenticated function
-        assert self.caller is not None
-
-        # make sure we are 'admin'
-        if 'admin' not in self.caller['roles']:
-               raise PLCPermissionDenied, "Not allowed to add node groups"
-
-       #creat node group
+       # Create node group
         node_group = NodeGroup(self.api, optional_vals)
         node_group['name'] = name
         node_group['description'] = description