mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -07:00
Prevent an empty error message
This commit is contained in:
parent
0ff77b3650
commit
4990814901
1 changed files with 5 additions and 1 deletions
|
@ -315,7 +315,11 @@ def setup_rax_module(module, rax_module, region_required=True):
|
||||||
else:
|
else:
|
||||||
raise Exception('No credentials supplied!')
|
raise Exception('No credentials supplied!')
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
module.fail_json(msg='%s' % e.message)
|
if e.message:
|
||||||
|
msg = str(e.message)
|
||||||
|
else:
|
||||||
|
msg = repr(e)
|
||||||
|
module.fail_json(msg=msg)
|
||||||
|
|
||||||
if region_required and region not in rax_module.regions:
|
if region_required and region not in rax_module.regions:
|
||||||
module.fail_json(msg='%s is not a valid region, must be one of: %s' %
|
module.fail_json(msg='%s is not a valid region, must be one of: %s' %
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue