X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAdmDeleteNodeGroup.py;h=b5b2cb6ce8605c6f34530497d4a9e0dc8e179a3f;hb=cb69eb4f365bef51c8f6e8615932383337c1f36a;hp=d780e59a0b01440c7934f2da48ff607380a735a5;hpb=5ac399f349470a15dc57d7261c97a69a17059f9f;p=plcapi.git diff --git a/PLC/Methods/AdmDeleteNodeGroup.py b/PLC/Methods/AdmDeleteNodeGroup.py index d780e59..b5b2cb6 100644 --- a/PLC/Methods/AdmDeleteNodeGroup.py +++ b/PLC/Methods/AdmDeleteNodeGroup.py @@ -1,42 +1,8 @@ -from PLC.Faults import * -from PLC.Method import Method -from PLC.Parameter import Parameter, Mixed -from PLC.Auth import PasswordAuth -from PLC.Nodes import Node, Nodes -from PLC.NodeGroups import NodeGroup, NodeGroups +from PLC.Methods.DeleteNodeGroup import DeleteNodeGroup -class AdmDeleteNodeGroup(Method): +class AdmDeleteNodeGroup(DeleteNodeGroup): """ - Delete an existing Node Group. - - Admins my delete any node group - - Returns 1 if successful, faults otherwise. + Deprecated. See DeleteNodeGroup. """ - roles = ['admin'] - - accepts = [ - PasswordAuth(), - NodeGroup.fields['nodegroup_id'], - ] - - returns = Parameter(int, '1 if successful') - - def call(self, auth, node_group_id): - # Get account information - nodegroups = NodeGroups(self.api, [node_group_id]) - if not nodegroups: - raise PLCInvalidArgument, "No such node group" - - nodegroup = nodegroups.values()[0] - - # If we are not an admin, make sure that the caller is a - # member of the site at which the node is located. - if 'admin' not in self.caller['roles']: - # Authenticated function - raise PLCPermissionDenied, "Not allowed to delete nodes groups" - - nodegroup.delete() - - return 1 + status = "deprecated"