Merge pull request #5179 from dhml/devel

Fix issue #5043: ec2_vpc module wait=yes state attribute retrieval
This commit is contained in:
jctanner 2013-12-05 07:55:10 -08:00
commit 01388d1d21

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