[PR #6983/a942545d backport][stable-7] Rundeck - fix TypeError on 404 api response #7041
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #6983 as merged into main (a942545).
Hello dear Ansible community :)
This is my first contribution, feel free to express any kind of criticism, be it on the content or the format.
SUMMARY
I found a bug when using
community.general.rundeck_acl_policy
.While creating a new ACL, I was greeted by the following trace:
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
On success, the
fetch_url
function returns something like:<addinfourl at 139713744344848 whose fp = <socket._fileobject object at 0x7f11a69761d0>>
However, when the api returns a 404, the return value is:
HTTP Error 404: Not Found
In such a case,
response.read()
fails with the aforementionned TypeError.The error could be specific to sundeck's API version. I did my testing with api version 40, which is not too far behind latest (v45), and way ahead of the current depreciation threshold (v14). source
Let me know if I am missing anything!
Have a great day :)