diff --git a/code/ddns-lambda.py b/code/ddns-lambda.py index b4f17f4..5aa8283 100755 --- a/code/ddns-lambda.py +++ b/code/ddns-lambda.py @@ -1673,34 +1673,37 @@ def new_change_resource_recordset(oclient, instance_id, zone_id, host_name, host # f"exception: {instance_id} err {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") except Route53.Client.exceptions.NoSuchHostedZone as err: - -# if 'NoSuchHostedZone' in str(err) and 'No hosted zone found with ID' in str(err): -3 LOGGER.error("Hosted zone not found error: %s", str(err) + lineno()) - LOGGER.info( - f"exception: NoSuchHostedZone {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") - update_response = "NoSuchHostedZone" - break + # 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()) + LOGGER.info( + f"exception: NoSuchHostedZone {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") + update_response = "NoSuchHostedZone" + break except Route53.Client.exceptions.InvalidChangeBatch as err: -# elif 'InvalidChangeBatch' in str(err) and 'is not permitted in zone' in str(err): -# LOGGER.error( -# "Cannot create record - most likely wrong zone name specified: %s", str(err) + lineno()) -# update_response = "InvalidChangeBatch-WrongZoneName" - LOGGER.info(f"exception: InvalidChangeBatch {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") - update_response = "InvalidChangeBatch" - break + # elif 'InvalidChangeBatch' in str(err) and 'is not permitted in zone' in str(err): + # LOGGER.error( + # "Cannot create record - most likely wrong zone name specified: %s", str(err) + lineno()) + # update_response = "InvalidChangeBatch-WrongZoneName" + LOGGER.info( + f"exception: InvalidChangeBatch {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") + update_response = "InvalidChangeBatch" + break except Route53.Client.exceptions.InvalidInput as err: - LOGGER.info(f"exception: InvalidInput {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") - update_response = "InvalidInput" - break + LOGGER.info( + f"exception: InvalidInput {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") + update_response = "InvalidInput" + break except Route53.Client.exceptions.PriorRequestNotComplete as err: -# elif "(Throttling)" in str(err): - LOGGER.info(f"exception: PriorRequestNotComplete {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") + # elif "(Throttling)" in str(err): + LOGGER.info( + f"exception: PriorRequestNotComplete {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") # LOGGER.debug("change_resource_record_sets UPSERT throttled due to API limit, retrying: %s", str(err) + lineno()) # else: # LOGGER.info( # f"instance: {instance_id} unexpected error: {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") except Exception as err: - LOGGER.info(f"exception: Exception {err} sys.exc_info {sys.exc_info()[0]} {sys.exc_info()[1]} {lineno()}") + LOGGER.info( + f"exception: Exception {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", @@ -1710,8 +1713,6 @@ def new_change_resource_recordset(oclient, instance_id, zone_id, host_name, host count['sleep.time'] += i count['retry'] += 1 - - if i >= MAX_API_RETRY: LOGGER.error("instance: %s, change_resource_record_sets exceeded max retry of %s", instance_id, str(MAX_API_RETRY) + lineno()) diff --git a/code/ddns-lambda.zip b/code/ddns-lambda.zip index c9458ee..b1cf110 100644 Binary files a/code/ddns-lambda.zip and b/code/ddns-lambda.zip differ