diff --git a/salt/modules/boto_route53.py b/salt/modules/boto_route53.py index 4f2c5ae9b001..834a508dcac8 100644 --- a/salt/modules/boto_route53.py +++ b/salt/modules/boto_route53.py @@ -107,6 +107,10 @@ def _get_split_zone(zone, _conn, private_zone): return False +def _is_retryable_error(exception): + return exception.code not in ['SignatureDoesNotMatch'] + + def describe_hosted_zones(zone_id=None, domain_name=None, region=None, key=None, keyid=None, profile=None): ''' @@ -270,7 +274,7 @@ def zone_exists(zone, region=None, key=None, keyid=None, profile=None, return bool(conn.get_zone(zone)) except DNSServerError as e: - if retry_on_errors: + if retry_on_errors and _is_retryable_error(e): if 'Throttling' == e.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == e.code: @@ -426,7 +430,7 @@ def create_healthcheck(ip_addr=None, fqdn=None, region=None, key=None, keyid=Non return {'result': conn.create_health_check(hc_)} except DNSServerError as exc: log.debug(exc) - if retry_on_errors: + if retry_on_errors and _is_retryable_error(exc): if 'Throttling' == exc.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == exc.code: @@ -519,7 +523,7 @@ def get_record(name, zone, record_type, fetch_all=False, region=None, key=None, break # the while True except DNSServerError as e: - if retry_on_errors: + if retry_on_errors and _is_retryable_error(e): if 'Throttling' == e.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == e.code: @@ -594,7 +598,7 @@ def add_record(name, value, zone, record_type, identifier=None, ttl=None, break except DNSServerError as e: - if retry_on_errors: + if retry_on_errors and _is_retryable_error(e): if 'Throttling' == e.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == e.code: @@ -615,7 +619,7 @@ def add_record(name, value, zone, record_type, identifier=None, ttl=None, return _wait_for_sync(status.id, conn, wait_for_sync) except DNSServerError as e: - if retry_on_errors: + if retry_on_errors and _is_retryable_error(e): if 'Throttling' == e.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == e.code: @@ -677,7 +681,7 @@ def update_record(name, value, zone, record_type, identifier=None, ttl=None, return _wait_for_sync(status.id, conn, wait_for_sync) except DNSServerError as e: - if retry_on_errors: + if retry_on_errors and _is_retryable_error(e): if 'Throttling' == e.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == e.code: @@ -738,7 +742,7 @@ def delete_record(name, zone, record_type, identifier=None, all_records=False, return _wait_for_sync(status.id, conn, wait_for_sync) except DNSServerError as e: - if retry_on_errors: + if retry_on_errors and _is_retryable_error(e): if 'Throttling' == e.code: log.debug('Throttled by AWS API.') elif 'PriorRequestNotComplete' == e.code: