1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #8262 from icoloma/patch-1

Bugfix: bulletproof unexpected_error_msg at gce.py
This commit is contained in:
Michael DeHaan 2014-07-28 11:03:54 -04:00
commit 20f65f2c79

View file

@ -27,6 +27,8 @@
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
import pprint
USER_AGENT_PRODUCT="Ansible-gce" USER_AGENT_PRODUCT="Ansible-gce"
USER_AGENT_VERSION="v1" USER_AGENT_VERSION="v1"
@ -64,7 +66,4 @@ def gce_connect(module):
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."""
msg='Unexpected response: HTTP return_code[' return 'Unexpected response: ' + pprint.pformat(vars(error))
msg+='%s], API error code[%s] and message: %s' % (
error.http_code, error.code, str(error.value))
return msg