openstack: Correct fail_json call in module_utils (#41064)

Fixes: #40925

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2018-06-04 13:48:15 +05:30 committed by Martin Krizek
parent 4d200fb5ac
commit 13c7d149bb

View file

@ -136,9 +136,9 @@ def openstack_cloud_from_module(module, min_version='0.12.0'):
'auth', 'region_name', 'verify',
'cacert', 'key', 'api_timeout', 'interface'):
if module.params[param] is not None:
module.fail_json(fail_message.format(param=param))
module.fail_json(msg=fail_message.format(param=param))
if module.params['auth_type'] != 'password':
module.fail_json(fail_message.format(param='auth_type'))
module.fail_json(msg=fail_message.format(param='auth_type'))
return sdk, sdk.connect(**cloud_config)
else:
return sdk, sdk.connect(