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:
d92a57b
)
check if the object is alredy bound to the peer
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 10 Aug 2009 19:47:41 +0000
(19:47 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Mon, 10 Aug 2009 19:47:41 +0000
(19:47 +0000)
PLC/Methods/BindObjectToPeer.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/BindObjectToPeer.py
b/PLC/Methods/BindObjectToPeer.py
index
36ac978
..
66bc703
100644
(file)
--- a/
PLC/Methods/BindObjectToPeer.py
+++ b/
PLC/Methods/BindObjectToPeer.py
@@
-62,6
+62,11
@@
class BindObjectToPeer(Method):
peer=peers[0]
object = self.locate_object (object_type, object_id)
+
+ # There is no need to continue if the object is already bound to this peer
+ if object['peer_id'] in [peer['peer_id']]:
+ return 1
+
adder_name = 'add_'+object_type
add_function = getattr(type(peer),adder_name)
add_function(peer,object,remote_object_id)