svn keywords
[plcapi.git] / PLC / Methods / AddBootState.py
index ba39b66..061edd4 100644 (file)
@@ -1,8 +1,10 @@
+# $Id$
+# $URL$
 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 +16,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