X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddBootState.py;h=522fd2519cd54e1f8f8ec7fdf55e05042daa0956;hb=bd0cbf4f7f2e4cf7ceda500bfa6f98c0a700018b;hp=ba39b66c32ddd50b3d915536f3a6851b45967d75;hpb=f8e0c71d96dce99eff25e5bb6bdf941468e897a2;p=plcapi.git diff --git a/PLC/Methods/AddBootState.py b/PLC/Methods/AddBootState.py index ba39b66..522fd25 100644 --- a/PLC/Methods/AddBootState.py +++ b/PLC/Methods/AddBootState.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.BootStates import BootState, BootStates -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class AddBootState(Method): """ @@ -14,19 +14,16 @@ class AddBootState(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), BootState.fields['boot_state'] ] returns = Parameter(int, '1 if successful') - event_type = 'Add' - object_type = 'BootState' - object_ids = [] - + def call(self, auth, name): boot_state = BootState(self.api) boot_state['boot_state'] = name - boot_state.sync() + boot_state.sync(insert = True) return 1