From 9a993992be56462dd39dba53d3d5310d324269d6 Mon Sep 17 00:00:00 2001 From: Charles Blonde Date: Sun, 8 Sep 2013 23:36:37 +0200 Subject: [PATCH 1/2] Fix wait_for conversion between String to int --- library/cloud/nova_compute | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cloud/nova_compute b/library/cloud/nova_compute index 3252f49dc9..250f204380 100644 --- a/library/cloud/nova_compute +++ b/library/cloud/nova_compute @@ -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) From 02171711fa27fc6cc73e540a7f6b2b73effd6a93 Mon Sep 17 00:00:00 2001 From: Charles Blonde Date: Sun, 8 Sep 2013 23:38:48 +0200 Subject: [PATCH 2/2] Fix wait_for default value to follow the documentation (documentation = 180, default value = 120) --- library/cloud/nova_compute | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/cloud/nova_compute b/library/cloud/nova_compute index 250f204380..5b43115fbd 100644 --- a/library/cloud/nova_compute +++ b/library/cloud/nova_compute @@ -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']) ), )