Merge pull request #4065 from CharlesBlonde/nova_wait_for_bug

Nova_compute wait_for fixes
pull/4058/merge
Michael DeHaan 11 years ago
commit 59099b7607

@ -135,7 +135,7 @@ def _delete_server(module, nova):
module.fail_json( msg = "Error in deleting vm: %s" % e.message)
if module.params['wait'] == 'no':
module.exit_json(changed = True, result = "deleted")
expire = time.time() + module.params['wait_for']
expire = time.time() + int(module.params['wait_for'])
while time.time() < expire:
name = nova.servers.list(True, {'name': module.params['name']})
if not name:
@ -160,7 +160,7 @@ def _create_server(module, nova):
except Exception as e:
module.fail_json( msg = "Error in creating instance: %s " % e.message)
if module.params['wait'] == 'yes':
expire = time.time() + module.params['wait_for']
expire = time.time() + int(module.params['wait_for'])
while time.time() < expire:
try:
server = nova.servers.get(server.id)
@ -220,7 +220,7 @@ def main():
nics = dict(default=None),
meta = dict(default=None),
wait = dict(default='yes', choices=['yes', 'no']),
wait_for = dict(default=120),
wait_for = dict(default=180),
state = dict(default='present', choices=['absent', 'present'])
),
)

Loading…
Cancel
Save