1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-09 21:47:17 +00:00

ipa module utils: detect and fail on errors in API response failed field (#11698)

* ipa_* modules: detect and fail on errors in API response ``failed`` field

Fixes: https://github.com/ansible-collections/community.general/issues/1239

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix chglog frag

* adjust chglog frag

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky 2026-03-31 07:41:10 +13:00 committed by GitHub
parent 68ae04a95a
commit 47ef322a5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,4 @@
bugfixes:
- "ipa module utils - fix failure to detect errors reported in the ``failed`` field of the IPA API response,
which is returned with HTTP 200 on partial or full failures in member add/remove operations
(https://github.com/ansible-collections/community.general/issues/1239, https://github.com/ansible-collections/community.general/pull/11698)."

View file

@ -159,6 +159,9 @@ class IPAClient:
if "result" in resp:
result = resp.get("result")
failed = result.get("failed")
if failed:
self._fail(f"response {method}", failed)
if "result" in result:
result = result.get("result")
if isinstance(result, list):