mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* fixed
* added changelog fragment
* improved fail output when placing JIRA API requests
* Update plugins/modules/web_infrastructure/jira.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e6c773a4f3
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
c055ea2bcc
commit
8df1b93531
2 changed files with 10 additions and 1 deletions
2
changelogs/fragments/3867-jira-fix-body.yaml
Normal file
2
changelogs/fragments/3867-jira-fix-body.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- jira - fixed bug where module returns error related to dictionary key ``body`` (https://github.com/ansible-collections/community.general/issues/3419).
|
|
@ -669,7 +669,14 @@ class JIRA(StateModuleHelper):
|
||||||
try:
|
try:
|
||||||
error = json.loads(info['body'])
|
error = json.loads(info['body'])
|
||||||
except Exception:
|
except Exception:
|
||||||
self.module.fail_json(msg=to_native(info['body']), exception=traceback.format_exc())
|
msg = 'The request "{method} {url}" returned the unexpected status code {status} {msg}\n{body}'.format(
|
||||||
|
status=info['status'],
|
||||||
|
msg=info['msg'],
|
||||||
|
body=info.get('body'),
|
||||||
|
url=url,
|
||||||
|
method=method,
|
||||||
|
)
|
||||||
|
self.module.fail_json(msg=to_native(msg), exception=traceback.format_exc())
|
||||||
if error:
|
if error:
|
||||||
msg = []
|
msg = []
|
||||||
for key in ('errorMessages', 'errors'):
|
for key in ('errorMessages', 'errors'):
|
||||||
|
|
Loading…
Reference in a new issue