Skip to content
Browse files

detect booting off by another agent

  • Loading branch information...
1 parent 32d692b commit 5dc3edd9c0f60276aea0046fc23e2b8eed4a0254 Jayson Vantuyl committed Apr 26, 2009
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/vertebra/conn/xmpp/client.py
View
11 lib/vertebra/conn/xmpp/client.py
@@ -68,6 +68,17 @@ def __init__(self,*args,**kwargs):
pyxmpp.all.Client.__init__(self,*args,**kwargs) #Client is old-style class
self.stream_class = vxClientStream # Use Our Modified Stream Class
+ def stream_error(self,err):
+ cond = err.get_condition()
+ if cond.name == "conflict":
+ error("booted by another agent")
+ # TODO: Use this to handle conflicting agents
+ # Maybe check last agent registration with Herault, whichever
+ # agent is older exits? Or should we just assume conflicts mean
+ # we should back off?
+ else:
+ pyxmpp.all.Client(self,err)
+
def loop(self,conn,timeout):
while conn.keep_running:
debug("loop")

0 comments on commit 5dc3edd

Please sign in to comment.
Something went wrong with that request. Please try again.