sqs-action.py is slightly more verbose
authorJustin Wind <j.wind@partner.samsung.com>
Thu, 14 Sep 2017 20:37:00 +0000 (13:37 -0700)
committerJustin Wind <j.wind@partner.samsung.com>
Thu, 14 Sep 2017 20:37:00 +0000 (13:37 -0700)
sqs-action.py

index a71d01d003620f8817793737bf6372d61758728c..e2b8c6431eb7a574e79bb342ef04d17cb70aa7d9 100755 (executable)
@@ -55,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()