Skip to content

Commit

Permalink
Rundeck - fix TypeError on 404 api response (#6983)
Browse files Browse the repository at this point in the history
* fix TypeError on 404 api response

* add changelog fragment

* Update changelogs/fragments/6983-rundeck-fix-typerrror-on-404-api-response.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Vincent CHARLES <vincent.charles@swatchgroup.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
  • Loading branch information
3 people authored Jul 31, 2023
1 parent 87053e5 commit a942545
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- rundeck - fix ``TypeError`` on 404 API response (https://github.com/ansible-collections/community.general/pull/6983).
4 changes: 3 additions & 1 deletion plugins/module_utils/rundeck.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def api_request(module, endpoint, data=None, method="GET"):
if info["status"] == 403:
module.fail_json(msg="Token authorization failed",
execution_info=json.loads(info["body"]))
if info["status"] == 409:
elif info["status"] == 404:
return None, info
elif info["status"] == 409:
module.fail_json(msg="Job executions limit reached",
execution_info=json.loads(info["body"]))
elif info["status"] >= 500:
Expand Down

0 comments on commit a942545

Please sign in to comment.