Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 26, 2023
1 parent d59e095 commit b534d45
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/ddns-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
LOGGER = logging.getLogger()
account_id = None
region = None
VERSION = '1.2.0b57'
VERSION = '1.2.0b58'

# Read Env variables
DEBUG_LOG_LEVEL = os.environ.get('DebugLogLevel', 'INFO')
Expand Down Expand Up @@ -403,13 +403,17 @@ def lambda_handler(
instance = get_item_from_dynamodb_table(dynamodb_client, DDBNAME, instance_id)
LOGGER.info("instance attributes: %s", str(instance) + lineno())
try:
LOGGER.info(f"instance_data type {type(instance)} {lineno()}")
instance_data = json.loads(instance)
LOGGER.info(f"getting _DnsEntries {lineno()}")
dns_data_raw = instance_data.get('_DnsEntries', [])
LOGGER.info(f"got _DnsEntries type {type(dns_data_raw}) value {dns_data_raw} {lineno()}")
dns_data = [dns_data_tuple(**item) for item in dns_data_raw]
LOGGER.info(f"converted _DnsEntries to namdtuples {dns_data} {lineno()}")
LOGGER.info(
f"Found entries from DDB for DNS records: {str(dns_data)} {lineno()}")
except:
LOGGER.error(f"Cannot deserialize instance data from DDB {lineno()}")
except Exception as err:
LOGGER.error(f"Cannot deserialize instance data from DDB: {err} {lineno()}")
dns_data = []

# Get the instance tags and reorder them because we want a zone created before CNAME
Expand Down

0 comments on commit b534d45

Please sign in to comment.