X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=PLC%2FMethods%2FDeleteBootState.py;h=507fc7b77982c3153428c2d297cc8039adf1899a;hb=918fbd1e95d3cbcf24a560e86ce9310a364f3000;hp=bf4175d9b72b3d0b91115713506abe5d7c038c15;hpb=0bb08c2256514d0091d05a5e2a5e19e963a59358;p=plcapi.git diff --git a/PLC/Methods/DeleteBootState.py b/PLC/Methods/DeleteBootState.py index bf4175d..507fc7b 100644 --- a/PLC/Methods/DeleteBootState.py +++ b/PLC/Methods/DeleteBootState.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 DeleteBootState(Method): """ @@ -17,18 +17,19 @@ class DeleteBootState(Method): roles = ['admin'] accepts = [ - PasswordAuth(), + Auth(), BootState.fields['boot_state'] ] returns = Parameter(int, '1 if successful') + def call(self, auth, name): boot_states = BootStates(self.api, [name]) if not boot_states: raise PLCInvalidArgument, "No such boot state" - boot_state = boot_states.values()[0] + boot_state = boot_states[0] boot_state.delete() - + return 1