From bcd9f8352128ad281d2c642286edc5c68ab66603 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 10 Mar 2015 11:30:12 -0500 Subject: [PATCH] Prevent an empty error message --- lib/ansible/modules/cloud/rackspace/rax.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/rackspace/rax.py b/lib/ansible/modules/cloud/rackspace/rax.py index 288d7307b82..874274c22f3 100644 --- a/lib/ansible/modules/cloud/rackspace/rax.py +++ b/lib/ansible/modules/cloud/rackspace/rax.py @@ -314,7 +314,11 @@ def create(module, names=[], flavor=None, image=None, meta={}, key_name=None, block_device_mapping_v2=bdmv2, **extra_create_args)) 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) else: changed = True