From 4163655099da8ada3c30a33178b0fa492cca6463 Mon Sep 17 00:00:00 2001 From: nitzmahone Date: Thu, 12 Nov 2015 16:30:46 -0800 Subject: [PATCH] fix gce module error reporting Error reporting was broken for GCE modules- pprint didn't work with exceptions, so you'd always get "Unexpected response: {}" instead of the real error. --- lib/ansible/module_utils/gce.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/gce.py b/lib/ansible/module_utils/gce.py index dc3a32700c..ad72a9b82b 100644 --- a/lib/ansible/module_utils/gce.py +++ b/lib/ansible/module_utils/gce.py @@ -28,7 +28,7 @@ # import os -import pprint +import traceback from libcloud.compute.providers import get_driver USER_AGENT_PRODUCT="Ansible-gce" @@ -92,4 +92,4 @@ def gce_connect(module, provider=None): def unexpected_error_msg(error): """Create an error string based on passed in error.""" - return 'Unexpected response: ' + pprint.pformat(vars(error)) + return 'Unexpected response: (%s). Detail: %s' % (str(error), traceback.format_exc(error))