mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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.
This commit is contained in:
parent
7fd8b86a10
commit
4163655099
1 changed files with 2 additions and 2 deletions
|
@ -28,7 +28,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pprint
|
import traceback
|
||||||
from libcloud.compute.providers import get_driver
|
from libcloud.compute.providers import get_driver
|
||||||
|
|
||||||
USER_AGENT_PRODUCT="Ansible-gce"
|
USER_AGENT_PRODUCT="Ansible-gce"
|
||||||
|
@ -92,4 +92,4 @@ def gce_connect(module, provider=None):
|
||||||
|
|
||||||
def unexpected_error_msg(error):
|
def unexpected_error_msg(error):
|
||||||
"""Create an error string based on passed in 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))
|
||||||
|
|
Loading…
Reference in a new issue