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

reviewable/pr18780/r1
David Hummel 12 years ago
parent 3bb1a263cf
commit fa93e03f22

@ -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 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…
Cancel
Save