[PR #11698/47ef322a backport][stable-12] ipa module utils: detect and fail on errors in API response failed field (#11710)

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



* fix chglog frag

* adjust chglog frag

---------


(cherry picked from commit 47ef322a5f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
patchback[bot]
2026-03-30 21:43:39 +02:00
committed by GitHub
parent 66d394dc81
commit 9d269ee8ca
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):