Merge branch 'fix/rc-5.2.6/decort_utils.py_decort_api_call' into 'rc-5.2.6'

Add response text to error msg of decort_api_call method

See merge request rudecs/dev/decort-ansible!11
rc-5.3.0^2
Алексей Даньков 11 months ago
commit a5f03389f2

@ -392,10 +392,12 @@ class DecortController(object):
retry_counter = retry_counter - 1 retry_counter = retry_counter - 1
else: else:
self.result['failed'] = True self.result['failed'] = True
self.result['msg'] = ("Error when calling DECORT API '{}', HTTP status code '{}', " self.result['msg'] = (
"reason '{}', parameters '{}'.").format(api_resp.url, f'Error when calling DECORT API {api_resp.url}'
api_resp.status_code, f', HTTP status code {api_resp.status_code}'
api_resp.reason, arg_params) f', reason "{api_resp.reason}"'
f', parameters {arg_params}, text {api_resp.text}.'
)
self.amodule.fail_json(**self.result) self.amodule.fail_json(**self.result)
return None # actually, this directive will never be executed as fail_json aborts the script return None # actually, this directive will never be executed as fail_json aborts the script

Loading…
Cancel
Save