From 29201c0dea4d6be05cf17650f2aeb06c2e534711 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 27 Apr 2015 11:59:11 -0500 Subject: [PATCH] Applying 499081490 fix for rax.py to v2 --- v2/ansible/module_utils/rax.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/v2/ansible/module_utils/rax.py b/v2/ansible/module_utils/rax.py index e92754a947f..73b48cc780d 100644 --- a/v2/ansible/module_utils/rax.py +++ b/v2/ansible/module_utils/rax.py @@ -315,7 +315,11 @@ def setup_rax_module(module, rax_module, region_required=True): else: raise Exception('No credentials supplied!') 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: module.fail_json(msg='%s is not a valid region, must be one of: %s' %