From 63a0b99b6a3ddfa5da4d548aefff51fa9aab609d Mon Sep 17 00:00:00 2001 From: Yair Fried Date: Mon, 25 Jan 2016 14:49:37 +0200 Subject: [PATCH] Fix glance_client module Wrong variable name. --- lib/ansible/modules/cloud/openstack/_glance_image.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/cloud/openstack/_glance_image.py b/lib/ansible/modules/cloud/openstack/_glance_image.py index 4d779f2c227..13ea23e48c0 100644 --- a/lib/ansible/modules/cloud/openstack/_glance_image.py +++ b/lib/ansible/modules/cloud/openstack/_glance_image.py @@ -238,6 +238,12 @@ def main(): argument_spec=argument_spec, mutually_exclusive = [['file','copy_from']], ) + + if not HAS_GLANCECLIENT: + module.fail_json(msg='python-glanceclient is required for this module') + if not HAS_KEYSTONECLIENT: + module.fail_json(msg='python-keystoneclient is required for this module') + if module.params['state'] == 'present': if not module.params['file'] and not module.params['copy_from']: module.fail_json(msg="Either file or copy_from variable should be set to create the image")