Commit 57428c48 by Nacho Coloma

Bugfix: bulletproof unexpected_error_msg at gce.py

This method was still failing for me with a "missing http_code" message. After applying this change, the error message is:

```
msg: Unexpected response: {'value': 'PyCrypto library required for Service Account Authentication.'}
```

I wanted to contribute a rock-solid `unexpected_error_msg` implementation.
parent d2a13097
......@@ -64,7 +64,5 @@ def gce_connect(module):
def unexpected_error_msg(error):
"""Create an error string based on passed in error."""
msg='Unexpected response: HTTP return_code['
msg+='%s], API error code[%s] and message: %s' % (
error.http_code, error.code, str(error.value))
return msg
import pprint
return 'Unexpected response: ' + pprint.pformat(vars(error))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment