svn keywords
[plcapi.git] / PLC / Methods / DeleteNode.py
index d0bf3a5..5919f03 100644 (file)
@@ -1,3 +1,5 @@
+# $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -24,9 +26,6 @@ class DeleteNode(Method):
 
     returns = Parameter(int, '1 if successful')
 
-    object_type = 'Node'
-
-
     def call(self, auth, node_id_or_hostname):
         # Get account information
         nodes = Nodes(self.api, [node_id_or_hostname])
@@ -46,10 +45,13 @@ class DeleteNode(Method):
             if node['site_id'] not in self.caller['site_ids']:
                 raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
 
+        node_id=node['node_id']
+        site_id=node['site_id']
         node.delete()
 
        # Logging variables
-       self.object_ids = [node['node_id']]
+        # it's not much use to attach to the node as it's going to vanish...
+       self.event_objects = {'Node': [node_id], 'Site': [site_id] }
        self.message = "Node %d deleted" % node['node_id']
 
         return 1