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 4d6a888 commit 528e9f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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.0b69'
VERSION = '1.2.0b70'

# Read Env variables
DEBUG_LOG_LEVEL = os.environ.get('DebugLogLevel', 'INFO')
Expand Down Expand Up @@ -1669,6 +1669,8 @@ def new_change_resource_recordset(oclient, instance_id, zone_id, host_name, host
str(update_response) + lineno())
break
except ClientError as err:
LOGGER.info(
f"exception: {instance_id} err {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}")
if 'NoSuchHostedZone' in str(err) and 'No hosted zone found with ID' in str(err):
LOGGER.error("Hosted zone not found error: %s", str(err) + lineno())
update_response = "NoSuchHostedZone"
Expand All @@ -1682,8 +1684,8 @@ def new_change_resource_recordset(oclient, instance_id, zone_id, host_name, host
LOGGER.debug("change_resource_record_sets UPSERT throttled due to API limit, retrying: %s", str(
err) + lineno())
else:
LOGGER.info("instance: %s, unexpected error. %s\n",
instance_id, str(err) + lineno())
LOGGER.info(
f"instance: {instance_id} unexpected error: {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}")

i += 1
LOGGER.info("instance: %s, change_resource_record_sets UPSERT returned error, waiting before retry. %s",
Expand Down Expand Up @@ -1735,7 +1737,7 @@ def create_resource_record(client, instance_id, zone_id, host_name, hosted_zone_
host_name, hosted_zone_name, record_type, value, lineno())
try:
LOGGER.debug(
"Updating %s in zone %s%s to %s %s", record_type, host_name,
"Updating %s in name %s zone %s to %s %s", record_type, host_name,
hosted_zone_name, value, lineno())

# To prevent rate throttling
Expand Down
Binary file modified code/ddns-lambda.zip
Binary file not shown.

0 comments on commit 528e9f7

Please sign in to comment.