- include PLC.Site, PLC.Sites
[plcapi.git] / PLC / Methods / UpdateNode.py
index b82325e..b20d3c5 100644 (file)
@@ -32,15 +32,14 @@ class UpdateNode(Method):
 
     returns = Parameter(int, '1 if successful')
 
-    object_type = 'Node'
-
     def call(self, auth, node_id_or_hostname, node_fields):
         node_fields = dict(filter(can_update, node_fields.items()))
 
        # 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])
@@ -64,7 +63,7 @@ class UpdateNode(Method):
         node.sync()
        
        # Logging variables
-       self.object_ids = [node['node_id']]
+       self.event_objects = {'Node': [node['node_id']]}
        self.message = 'Node %d updated: %s.' % \
                (node['node_id'], ", ".join(node_fields.keys()))
        if 'boot_state' in node_fields.keys():