From f47ae5dea9a7ad075c5464b4231e38d72a0cfc00 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Tue, 19 Sep 2006 19:05:49 +0000 Subject: [PATCH] - fix documentation for return value - remove redundant roles check --- PLC/Methods/AdmAddNodeGroup.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/PLC/Methods/AdmAddNodeGroup.py b/PLC/Methods/AdmAddNodeGroup.py index 77d1ba55..3468cf1b 100644 --- a/PLC/Methods/AdmAddNodeGroup.py +++ b/PLC/Methods/AdmAddNodeGroup.py @@ -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 -- 2.47.0