X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddKeyType.py;h=b3690a86ddf393281b8fc94b8d2aa41081c21f86;hb=128315ccc28ad8daf833d11c43747c8684e1b910;hp=914323c326e05d1fb4700d90369ca5911d2981d2;hpb=f8e0c71d96dce99eff25e5bb6bdf941468e897a2;p=plcapi.git diff --git a/PLC/Methods/AddKeyType.py b/PLC/Methods/AddKeyType.py index 914323c..b3690a8 100644 --- a/PLC/Methods/AddKeyType.py +++ b/PLC/Methods/AddKeyType.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 AddKeyType(Method): """ @@ -14,18 +14,16 @@ class AddKeyType(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), KeyType.fields['key_type'] ] returns = Parameter(int, '1 if successful') - event_type = 'Add' - object_type = 'KeyType' def call(self, auth, name): key_type = KeyType(self.api) key_type['key_type'] = name - key_type.sync() + key_type.sync(insert = True) return 1