git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ba08a2
)
- only allow addition of nodes at the same site
author
Mark Huang
<mlhuang@cs.princeton.edu>
Wed, 25 Oct 2006 16:58:19 +0000
(16:58 +0000)
committer
Mark Huang
<mlhuang@cs.princeton.edu>
Wed, 25 Oct 2006 16:58:19 +0000
(16:58 +0000)
PLC/Methods/AddNodeToPCU.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/AddNodeToPCU.py
b/PLC/Methods/AddNodeToPCU.py
index
5378987
..
2d06f9f
100644
(file)
--- a/
PLC/Methods/AddNodeToPCU.py
+++ b/
PLC/Methods/AddNodeToPCU.py
@@
-59,10
+59,14
@@
class AddNodeToPCU(Method):
if node['node_id'] in pcu['node_ids']:
raise PLCInvalidArgument, "Node already controlled by PCU"
+ if node['site_id'] != pcu['site_id']:
+ raise PLCInvalidArgument, "Node is at a different site than this PCU"
+
if port in pcu['ports']:
raise PLCInvalidArgument, "PCU port already in use"
pcu.add_node(node, port)
- self.object_ids = [pcu['pcu_id']]
+
+ self.object_ids = [node['node_id'], pcu['pcu_id']]
return 1