Commit 804fce06 by Feanil Patel

Catch keyerrors.

parent 256493c5
...@@ -407,6 +407,7 @@ def poll_sqs_ansible(): ...@@ -407,6 +407,7 @@ def poll_sqs_ansible():
now = int(time.time()) now = int(time.time())
if buf: if buf:
try:
if (now - max([msg['recv_ts'] for msg in buf])) > args.msg_delay: if (now - max([msg['recv_ts'] for msg in buf])) > args.msg_delay:
# sort by TS instead of recv_ts # sort by TS instead of recv_ts
# because the sqs timestamp is not as # because the sqs timestamp is not as
...@@ -461,6 +462,8 @@ def poll_sqs_ansible(): ...@@ -461,6 +462,8 @@ def poll_sqs_ansible():
completed += 1 completed += 1
if completed >= NUM_PLAYBOOKS: if completed >= NUM_PLAYBOOKS:
return (to_disp['msg']['TS'], task_report) return (to_disp['msg']['TS'], task_report)
except KeyError:
print "Failed to print status from message: {}".format(to_disp)
if not messages: if not messages:
# wait 1 second between sqs polls # wait 1 second between sqs polls
......
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