Merge pull request #5179 from dhml/devel
Fix issue #5043: ec2_vpc module wait=yes state attribute retrieval
This commit is contained in:
commit
01388d1d21
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