svn keywords
[plcapi.git] / PLC / Methods / AddNetworkMethod.py
index d243ae3..3932f34 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.NetworkMethods import NetworkMethod, NetworkMethods
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
 
 class AddNetworkMethod(Method):
     """
@@ -14,18 +16,16 @@ class AddNetworkMethod(Method):
     roles = ['admin']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         NetworkMethod.fields['method']
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    event_type = 'Add'
-    object_type = 'NetworkMethod'
 
     def call(self, auth, name):
         network_method = NetworkMethod(self.api)
         network_method['method'] = name
-        network_method.sync()
+        network_method.sync(insert = True)
 
         return 1