message.delete()
else:
notice += ['no action taken: no playbook for this ASG']
+ message.delete()
notify(notice[0], '\n'.join(notice))
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)
- message.delete()
+ 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()