Bug#1037126: ansible-core: Patch to fix URI Module find json sub type
Am 08.06.23 um 18:37 schrieb Lee Garrett: I acknowledge this bug, and will issue a point release update once it has been merged upstream. Hello Lee, meanwhile, upstream has merged the change also in stable-2.14, see [1]. After successful registering with salsa, I also opened a MR in ansible-core repo [2]. [1] https://github.com/ansible/ansible/pull/80870 [2] https://salsa.debian.org/debian/ansible-core/-/merge_requests/2 Thanks for efforts maintaining ansible in debian! Grüße Berni
Bug#1037126: ansible-core: Patch to fix URI Module find json sub type
Hi Bernhard, I acknowledge this bug, and will issue a point release update once it has been merged upstream. Thanks for the report! Greets, Lee On 05.06.23 15:21, Bernhard Turmann wrote: Source: ansible-core Source-Version: 2.14.3-1 Severity: important Tags: fixed-upstream, patch, upstream Dear Maintainer, the attached patch applied in upstream commit [0] will fix ansible-core 2.14.3-1 in Debian 12 Bookworm having an issue with the URI module recognizing JSON with some API endpoints correctly. I am using this module in many tasks with the CEPH Dashboard API and confirm the patch is fixing it successfully. Without the patch, all these tasks are failing after installing a fresh Debian Bookworm. Note: The ansible version in Bullseye was working fine in this regard. Upstream has an open PR [1] against stable-2.14, but not merged yet. I would have opened a Merge Request on Salsa, but I just registered and waiting for approval. [0] https://github.com/ansible/ansible/commit/0c7361d9acf7c8966a09f67de2a8679ef86fd856 [1] https://github.com/ansible/ansible/pull/80870 With Best Regards Berni
Bug#1037126: ansible-core: Patch to fix URI Module find json sub type
Source: ansible-core Source-Version: 2.14.3-1 Severity: important Tags: fixed-upstream, patch, upstream Dear Maintainer, the attached patch applied in upstream commit [0] will fix ansible-core 2.14.3-1 in Debian 12 Bookworm having an issue with the URI module recognizing JSON with some API endpoints correctly. I am using this module in many tasks with the CEPH Dashboard API and confirm the patch is fixing it successfully. Without the patch, all these tasks are failing after installing a fresh Debian Bookworm. Note: The ansible version in Bullseye was working fine in this regard. Upstream has an open PR [1] against stable-2.14, but not merged yet. I would have opened a Merge Request on Salsa, but I just registered and waiting for approval. [0] https://github.com/ansible/ansible/commit/0c7361d9acf7c8966a09f67de2a8679ef86fd856 [1] https://github.com/ansible/ansible/pull/80870 With Best Regards Berni--- /usr/lib/python3/dist-packages/ansible/modules/uri.py 2023-03-01 21:06:21.0 +0100 +++ /tmp/uri.py 2023-06-03 16:51:49.224330090 +0200 @@ -699,7 +699,14 @@ sub_type = 'octet-stream' content_encoding = 'utf-8' -maybe_json = content_type and sub_type.lower() in JSON_CANDIDATES +if sub_type and '+' in sub_type: +# https://www.rfc-editor.org/rfc/rfc6839#section-3.1 +sub_type_suffix = sub_type.partition('+')[2] +maybe_json = content_type and sub_type_suffix.lower() in JSON_CANDIDATES +elif sub_type: +maybe_json = content_type and sub_type.lower() in JSON_CANDIDATES +else: +maybe_json = False maybe_output = maybe_json or return_content or info['status'] not in status_code if maybe_output: