Skip to content

Commit

Permalink
Work around get_waiter not knowing how to cope with _RetryingBotoClie…
Browse files Browse the repository at this point in the history
…ntWrapper
  • Loading branch information
tremble committed Jul 27, 2020
1 parent 74a074b commit e9acf96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/modules/ec2_vpc_vgw.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ def create_vgw(client, module):

try:
response = client.create_vpn_gateway(aws_retry=True, **params)
# XXX get_waiter doesn't like being passed a 'decorated' client
get_waiter(
client, 'vpn_gateway_exists'
client.client, 'vpn_gateway_exists'
).wait(
VpnGatewayIds=[response['VpnGateway']['VpnGatewayId']]
)
Expand Down Expand Up @@ -423,7 +424,8 @@ def ensure_vgw_present(client, module):
# detach the existing vpc from the virtual gateway
vpc_to_detach = current_vpc_attachments[0]['VpcId']
detach_vgw(client, module, vpn_gateway_id, vpc_to_detach)
get_waiter(client, 'vpn_gateway_detached').wait(VpnGatewayIds=[vpn_gateway_id])
# XXX get_waiter doesn't like being passed a 'decorated' client
get_waiter(client.client, 'vpn_gateway_detached').wait(VpnGatewayIds=[vpn_gateway_id])
attached_vgw = attach_vgw(client, module, vpn_gateway_id)
changed = True
else:
Expand Down

0 comments on commit e9acf96

Please sign in to comment.