Skip to content

Commit

Permalink
do not log activity if activity could not be found
Browse files Browse the repository at this point in the history
  • Loading branch information
janschumann committed Jan 28, 2019
1 parent 723f280 commit 08b6169
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions AutoscalingLifecycle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,14 @@ def __log_autoscaling_activity(self, event_data: EventData):
_lifecycle_data.is_launching(),
_lifecycle_data.get_instance_id()
)
self.__get_logger().info('%s %s autoscaling activity on event %s: %s', activity.get('StatusCode').upper(),
'launching' if _lifecycle_data.is_launching else 'terminating',
repr(event_data), activity)

if activity == dict():
self.__get_logger().warning('Could not find autoscaling activity for node %s',
_lifecycle_data.get_instance_id())
else:
self.__get_logger().info('%s %s autoscaling activity on event %s: %s', activity.get('StatusCode').upper(),
'launching' if _lifecycle_data.is_launching else 'terminating',
repr(event_data), activity)


#
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name = "AutoscalingLifecycle",
version = "1.0.0",
version = "1.0.1",
author = "Jan Schumann",
author_email = "[email protected]",
description = "A library to handle aws autoscaling lifecycle events",
Expand Down

0 comments on commit 08b6169

Please sign in to comment.