Commit 614efadb by David Hummel

Fix issue #5043: ec2_vpc module wait=yes state attribute retrieval

parent cbfeb0a2
...@@ -233,8 +233,12 @@ def create_vpc(module, vpc_conn): ...@@ -233,8 +233,12 @@ def create_vpc(module, vpc_conn):
wait_timeout = time.time() + wait_timeout wait_timeout = time.time() + wait_timeout
while wait and wait_timeout > time.time() and pending: while wait and wait_timeout > time.time() and pending:
pvpc = vpc_conn.get_all_vpcs(vpc.id) pvpc = vpc_conn.get_all_vpcs(vpc.id)
if pvpc.state == "available": if hasattr(pvpc, 'state'):
pending = False if pvpc.state == "available":
pending = False
elif hasattr(pvpc[0], 'state'):
if pvpc[0].state == "available":
pending = False
time.sleep(5) time.sleep(5)
if wait and wait_timeout <= time.time(): if wait and wait_timeout <= time.time():
# waiting took too long # waiting took too long
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment