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