mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 17:23:09 +00:00
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.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user