Merge pull request #47430 from baniobloom/vpc_association_not_found

Add catch for VPCAssociationNotFound
This commit is contained in:
Nicole Thomas 2018-05-22 10:54:00 -04:00 committed by GitHub
commit 17c4c8443c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -640,6 +640,10 @@ def disassociate_vpc_from_hosted_zone(HostedZoneId=None, Name=None, VPCId=None,
r = conn.disassociate_vpc_from_hosted_zone(**args)
return _wait_for_sync(r['ChangeInfo']['Id'], conn)
except ClientError as e:
if e.response.get('Error', {}).get('Code') == 'VPCAssociationNotFound':
log.debug('No VPC Association 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)