(*) Peer has new fields person_ids and site_ids
[plcapi.git] / PLC / Methods / DeleteNode.py
index 038ed59..0f07230 100644 (file)
@@ -24,13 +24,15 @@ class DeleteNode(Method):
 
     returns = Parameter(int, '1 if successful')
 
+
     def call(self, auth, node_id_or_hostname):
         # Get account information
         nodes = Nodes(self.api, [node_id_or_hostname])
         if not nodes:
             raise PLCInvalidArgument, "No such node"
 
-        node = nodes.values()[0]
+        node = nodes[0]
+       PLCCheckLocalNode(node,"DeleteNode")
 
         # If we are not an admin, make sure that the caller is a
         # member of the site at which the node is located.
@@ -42,5 +44,6 @@ class DeleteNode(Method):
                 raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
 
         node.delete()
+       self.object_ids = [node['node_id']]
 
         return 1