Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 27, 2023
1 parent 16f114b commit 65cf0ca
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions code/ddns-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -3265,18 +3265,17 @@ def evaluate_event_action(event):

e_source = event['source']
action = None
# try:
if True:
try:
if e_source == 'aws.ec2':
e_instance_id = event['detail']['instance-id']
e_state = event['detail']['state']
action = "ADD" if e_state == "running" else "DELETE"
LOGGER.info(
f"event_action ** {action} ** instance_id {instance_id} instance_state {e_state}")
f"event_action ** {action} ** instance_id {e_instance_id} instance_state {e_state}")
else:
LOGGER.info(f"event_action unrecognized source {e_source}")
# except:
# LOGGER.error(f"event_action event structure cannot be parsed {lineno()}")
except:
LOGGER.error(f"event_action event structure cannot be parsed {lineno()}")
return action


Expand Down

0 comments on commit 65cf0ca

Please sign in to comment.