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:
parent
68ae04a95a
commit
47ef322a5f
2 changed files with 7 additions and 0 deletions
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue