1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix wait_for conversion between String to int

This commit is contained in:
Charles Blonde 2013-09-08 23:36:37 +02:00
parent ddb09f11be
commit 9a993992be

View file

@ -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)