mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-10 02:41:30 +00:00
[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:
4
changelogs/fragments/11698-ipa-failed-response.yml
Normal file
4
changelogs/fragments/11698-ipa-failed-response.yml
Normal 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)."
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user