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"
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"
# If we are not an admin, make sure that the caller is a
# member of the site at which the node is located.
if 'admin' not in self.caller['roles']:
# If we are not an admin, make sure that the caller is a
# member of the site at which the node is located.
if 'admin' not in self.caller['roles']:
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
- self.object_ids = [node['node_id']]
+
+ # Logging variables
+ # 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']