X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=sqs-action.py;h=e2b8c6431eb7a574e79bb342ef04d17cb70aa7d9;hb=36c9912430e4652fd08258881dc154fe7ddb966a;hp=f092fd76b99dcb8d8c43abcf647933fee61bea5d;hpb=e508dbef1fbcebb59d2e35fb0c5acc65a0186fae;p=awsible diff --git a/sqs-action.py b/sqs-action.py index f092fd7..e2b8c64 100755 --- a/sqs-action.py +++ b/sqs-action.py @@ -43,6 +43,7 @@ def handleEvent(message, event, ASGName, InstanceId): message.delete() else: notice += ['no action taken: no playbook for this ASG'] + message.delete() notify(notice[0], '\n'.join(notice)) @@ -54,23 +55,23 @@ def processMessage(message): ASGName = data['AutoScalingGroupName'] InstanceId = data['EC2InstanceId'] except: - logging.debug('unparsable message %r', message.body) + logging.warning('unparsable message %r', message.body) message.delete() else: if event == 'autoscaling:EC2_INSTANCE_LAUNCH': try: instanceState = ec2r.Instance(InstanceId).state['Name'] except: - logging.debug('instance %s does not exist', InstanceId) + logging.warning('instance %s does not exist', InstanceId) message.change_visibility(VisibilityTimeout=60 * 2) else: if instanceState == 'running': handleEvent(message, event, ASGName, InstanceId) else: - logging.debug('instance %s is in state %s, will try again', InstanceId, instanceState) + logging.warning('instance %s is in state %s, will try again', InstanceId, instanceState) message.change_visibility(VisibilityTimeout=60 * 2) else: - logging.debug('nothing to do for event %r', data) + logging.warning('nothing to do for event %r', data) message.delete()