checks for existence of keys before deleting with non-admin users
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 23 Feb 2007 16:30:07 +0000 (16:30 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 23 Feb 2007 16:30:07 +0000 (16:30 +0000)
PLC/Methods/UpdateNode.py

index b82325e..28a0413 100644 (file)
@@ -40,7 +40,8 @@ class UpdateNode(Method):
        # Remove admin only fields
        if 'admin' not in self.caller['roles']:
             for key in 'key', 'session', 'boot_nonce':
-                del node_fields[key]
+                if node_fields.has_key(key):
+                    del node_fields[key]
 
         # Get account information
         nodes = Nodes(self.api, [node_id_or_hostname])