X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FDeleteNetworkMethod.py;h=d0f982e363bc3443651df8edddc8a000544013e3;hb=929d1cbbc300f8a33cf0cfe9d6add3b898e0c552;hp=13c527ebd9ad7c167e18922b54690db6ebd7683b;hpb=d0d8c9704f83a2f6a3e68bbde7fb7cdd328ffa51;p=plcapi.git diff --git a/PLC/Methods/DeleteNetworkMethod.py b/PLC/Methods/DeleteNetworkMethod.py index 13c527e..d0f982e 100644 --- a/PLC/Methods/DeleteNetworkMethod.py +++ b/PLC/Methods/DeleteNetworkMethod.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.NetworkMethods import NetworkMethod, NetworkMethods -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteNetworkMethod(Method): """ @@ -17,17 +17,18 @@ class DeleteNetworkMethod(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), NetworkMethod.fields['method'] ] returns = Parameter(int, '1 if successful') + def call(self, auth, name): network_methods = NetworkMethods(self.api, [name]) if not network_methods: raise PLCInvalidArgument, "No such network method" - network_method = network_methods.values()[0] + network_method = network_methods[0] network_method.delete()