X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FDeleteConfFile.py;h=f05ae43f17177ffd52f03c465dec5a3626695915;hb=refs%2Fheads%2Fplanetlab-4_0-branch;hp=226e9ddb9063c24057bef1dd8c4c164e13ecef73;hpb=e2a641e829dd304c1b56b534e314f23092e335ab;p=plcapi.git diff --git a/PLC/Methods/DeleteConfFile.py b/PLC/Methods/DeleteConfFile.py index 226e9dd..f05ae43 100644 --- a/PLC/Methods/DeleteConfFile.py +++ b/PLC/Methods/DeleteConfFile.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.ConfFiles import ConfFile, ConfFiles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteConfFile(Method): """ @@ -14,18 +14,20 @@ class DeleteConfFile(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), ConfFile.fields['conf_file_id'] ] returns = Parameter(int, '1 if successful') + def call(self, auth, conf_file_id): - conf_files = ConfFiles(self.api, [conf_file_id]).values() + conf_files = ConfFiles(self.api, [conf_file_id]) if not conf_files: raise PLCInvalidArgument, "No such configuration file" conf_file = conf_files[0] conf_file.delete() + self.event_objects = {'ConfFile': [conf_file['conf_file_id']]} return 1