git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- subclass the correct class
[plcapi.git]
/
PLC
/
Methods
/
DeleteNodeFromPCU.py
diff --git
a/PLC/Methods/DeleteNodeFromPCU.py
b/PLC/Methods/DeleteNodeFromPCU.py
index
02ddfcc
..
0cf0845
100644
(file)
--- a/
PLC/Methods/DeleteNodeFromPCU.py
+++ b/
PLC/Methods/DeleteNodeFromPCU.py
@@
-25,8
+25,6
@@
class DeleteNodeFromPCU(Method):
returns = Parameter(int, '1 if successful')
returns = Parameter(int, '1 if successful')
- event_type = 'DeleteFrom'
- object_type = 'PCU'
def call(self, auth, node_id_or_hostname, pcu_id):
# Get node
def call(self, auth, node_id_or_hostname, pcu_id):
# Get node
@@
-54,9
+52,13
@@
class DeleteNodeFromPCU(Method):
raise PLCPermissionDenied, "Not allowed to update that PCU"
# Removed node from PCU
raise PLCPermissionDenied, "Not allowed to update that PCU"
# Removed node from PCU
+
if node['node_id'] in pcu['node_ids']:
pcu.remove_node(node)
if node['node_id'] in pcu['node_ids']:
pcu.remove_node(node)
+ # Logging variables
self.object_ids = [pcu['pcu_id']]
self.object_ids = [pcu['pcu_id']]
-
+ self.message = 'Node %d removed from PCU %d' % \
+ (node['node_id'], pcu['pcu_id'])
+
return 1
return 1