Commit b999dc50 authored by Federico Sismondi's avatar Federico Sismondi

updated messages lib, and fixed worngly used message type in agent's bootstrap mechanism

parent dc19a9ef
...@@ -8,9 +8,9 @@ import time ...@@ -8,9 +8,9 @@ import time
# for using it as library and as a __main__ # for using it as library and as a __main__
try: try:
from messages import MsgAgentConfigured, MsgAgentTunStart, Message from messages import MsgAgentTunStarted, MsgAgentTunStart, Message
except: except:
from .messages import MsgAgentConfigured, MsgAgentTunStart, Message from .messages import MsgAgentTunStarted, MsgAgentTunStart, Message
logging.getLogger('pika').setLevel(logging.INFO) logging.getLogger('pika').setLevel(logging.INFO)
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
...@@ -59,7 +59,7 @@ def check_response(channel, queue_name, agent_id): ...@@ -59,7 +59,7 @@ def check_response(channel, queue_name, agent_id):
try: try:
msg = Message.load_from_pika(method, header, body) msg = Message.load_from_pika(method, header, body)
print('got message: %s' % repr(msg)) print('got message: %s' % repr(msg))
if isinstance(msg, MsgAgentConfigured) and == agent_id: if isinstance(msg, MsgAgentTunStarted) and == agent_id:
return True return True
except Exception as e: except Exception as e:
logging.error(str(e)) logging.error(str(e))
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment