mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix issue #5043: ec2_vpc module wait=yes state attribute retrieval
This commit is contained in:
parent
cbfeb0a2ea
commit
614efadb7a
1 changed files with 6 additions and 2 deletions
|
@ -233,8 +233,12 @@ def create_vpc(module, vpc_conn):
|
|||
wait_timeout = time.time() + wait_timeout
|
||||
while wait and wait_timeout > time.time() and pending:
|
||||
pvpc = vpc_conn.get_all_vpcs(vpc.id)
|
||||
if pvpc.state == "available":
|
||||
pending = False
|
||||
if hasattr(pvpc, 'state'):
|
||||
if pvpc.state == "available":
|
||||
pending = False
|
||||
elif hasattr(pvpc[0], 'state'):
|
||||
if pvpc[0].state == "available":
|
||||
pending = False
|
||||
time.sleep(5)
|
||||
if wait and wait_timeout <= time.time():
|
||||
# waiting took too long
|
||||
|
|
Loading…
Reference in a new issue