Merge pull request #47480 from baniobloom/ConflictingDomainExists

added handling for the aws error ConflictingDomainExists
This commit is contained in:
Nicole Thomas 2018-05-07 15:05:27 -04:00 committed by GitHub
commit 2f50ff7bc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -544,6 +544,10 @@ def associate_vpc_with_hosted_zone(HostedZoneId=None, Name=None, VPCId=None,
r = conn.associate_vpc_with_hosted_zone(**args)
return _wait_for_sync(r['ChangeInfo']['Id'], conn)
except ClientError as e:
if e.response.get('Error', {}).get('Code') == 'ConflictingDomainExists':
log.debug('VPC Association already exists.')
# return True since the current state is the desired one
return True
if tries and e.response.get('Error', {}).get('Code') == 'Throttling':
log.debug('Throttled by AWS API.')
time.sleep(3)