X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FDeleteKeyType.py;h=2554cb030a2b50b76b1457805aa68639b7c70dff;hb=2696eec3582eb1b1092d0a98c863a040f6aa2af4;hp=9f230a94dbe13dc355ced5a59b62daedc366fb15;hpb=3e3a4cdc823571fbf7248d027a8374b37a708615;p=plcapi.git diff --git a/PLC/Methods/DeleteKeyType.py b/PLC/Methods/DeleteKeyType.py index 9f230a9..2554cb0 100644 --- a/PLC/Methods/DeleteKeyType.py +++ b/PLC/Methods/DeleteKeyType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.KeyTypes import KeyType, KeyTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class DeleteKeyType(Method): """ @@ -16,17 +16,20 @@ class DeleteKeyType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), KeyType.fields['key_type'] ] returns = Parameter(int, '1 if successful') - + + event_type = 'Delete' + object_type = 'KeyType' + def call(self, auth, name): key_types = KeyTypes(self.api, [name]) if not key_types: raise PLCInvalidArgument, "No such key type" - key_type = key_types.values()[0] + key_type = key_types[0] key_type.delete()