get rid of svn keywords once and for good
[plcapi.git] / PLC / Methods / AddKeyType.py
index 86c2bc9..b3690a8 100644 (file)
@@ -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,15 +14,16 @@ class AddKeyType(Method):
     roles = ['admin']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         KeyType.fields['key_type']
         ]
 
     returns = Parameter(int, '1 if successful')
 
+
     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