ec2_vpc_vpn: Add delay and wait_timeout parameter (#53940)

* ec2_vpc_vpn: Add delay and wait_timeout parameter

Fixes: #53481

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Fix unit tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2019-03-18 21:35:51 +05:30 committed by Sloane Hertel
commit 3fa39ac818
2 changed files with 40 additions and 10 deletions

View file

@ -96,7 +96,9 @@ def make_params(cgw, vgw, tags=None, filters=None, routes=None):
'purge_tags': True,
'tags': tags,
'filters': filters,
'routes': routes}
'routes': routes,
'delay': 15,
'wait_timeout': 600}
def make_conn(placeboify, module, connection):
@ -111,7 +113,7 @@ def make_conn(placeboify, module, connection):
def tear_down_conn(placeboify, connection, vpn_connection_id):
ec2_vpc_vpn.delete_connection(connection, vpn_connection_id)
ec2_vpc_vpn.delete_connection(connection, vpn_connection_id, delay=15, max_attempts=40)
def test_find_connection_vpc_conn_id(placeboify, maybe_sleep):
@ -251,7 +253,7 @@ def test_delete_connection(placeboify, maybe_sleep):
def test_delete_nonexistent_connection(placeboify, maybe_sleep):
# create parameters and ensure any connection matching (None) is deleted
params = {'filters': {'tags': {'ThisConnection': 'DoesntExist'}}}
params = {'filters': {'tags': {'ThisConnection': 'DoesntExist'}}, 'delay': 15, 'wait_timeout': 600}
m, conn = setup_mod_conn(placeboify, params)
changed, vpn = ec2_vpc_vpn.ensure_absent(conn, m.params)