mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-07-28 18:54:29 +00:00
Fix non existing attribuites in SDK exception
SDK exception may not have extra_data, details or response attributes. Print None in this case. Change-Id: Ic4073c28a4e4afb8ca5d2b72c4ea8582da244af1
This commit is contained in:
@@ -392,9 +392,10 @@ class OpenStackModule:
|
|||||||
params = {
|
params = {
|
||||||
'msg': str(e),
|
'msg': str(e),
|
||||||
'extra_data': {
|
'extra_data': {
|
||||||
'data': e.extra_data,
|
'data': getattr(e, 'extra_data', 'None'),
|
||||||
'details': e.details,
|
'details': getattr(e, 'details', 'None'),
|
||||||
'response': e.response.text
|
'response': getattr(getattr(e, 'response', ''),
|
||||||
|
'text', 'None')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.ansible.fail_json(**params)
|
self.ansible.fail_json(**params)
|
||||||
|
|||||||
Reference in New Issue
Block a user