1
0
Fork 0
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:
David Hummel 2013-12-05 10:47:22 -05:00
parent cbfeb0a2ea
commit 614efadb7a

View file

@ -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