- Change .py files to use 4-space indents and no hard tab characters.
[plcapi.git] / PLC / Methods / DeleteKeyType.py
index 9f230a9..d227368 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.KeyTypes import KeyType, KeyTypes
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
 
 class DeleteKeyType(Method):
     """
@@ -16,17 +18,18 @@ class DeleteKeyType(Method):
     roles = ['admin']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         KeyType.fields['key_type']
         ]
 
     returns = Parameter(int, '1 if successful')
 
+
     def call(self, auth, name):
         key_types = KeyTypes(self.api, [name])
         if not key_types:
             raise PLCInvalidArgument, "No such key type"
-        key_type = key_types.values()[0]
+        key_type = key_types[0]
 
         key_type.delete()