From ca22c6fe26d74607981e7562563e401033f82d02 Mon Sep 17 00:00:00 2001 From: Lee Garrett Date: Wed, 13 May 2026 13:20:49 +0200 Subject: [PATCH] Fix _AnsibleActionDone deprecation in patch plugin (#687) Signed-off-by: Abhijeet Kasurde Co-authored-by: Lee Garrett --- changelogs/fragments/patch_removed.yml | 3 +++ plugins/action/patch.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/patch_removed.yml diff --git a/changelogs/fragments/patch_removed.yml b/changelogs/fragments/patch_removed.yml new file mode 100644 index 0000000..579f64f --- /dev/null +++ b/changelogs/fragments/patch_removed.yml @@ -0,0 +1,3 @@ +--- +removed_features: + - patch - removed deprecated _AnsibleActionDone API (https://github.com/ansible-collections/ansible.posix/pull/687). diff --git a/plugins/action/patch.py b/plugins/action/patch.py index ea82ed6..0992a3d 100644 --- a/plugins/action/patch.py +++ b/plugins/action/patch.py @@ -20,7 +20,7 @@ __metaclass__ = type import os -from ansible.errors import AnsibleError, AnsibleAction, _AnsibleActionDone, AnsibleActionFail +from ansible.errors import AnsibleError, AnsibleAction, AnsibleActionFail from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.parsing.convert_bool import boolean from ansible.plugins.action import ActionBase @@ -46,7 +46,8 @@ class ActionModule(ActionBase): elif remote_src: # everything is remote, so we just execute the module # without changing any of the module arguments - raise _AnsibleActionDone(result=self._execute_module(task_vars=task_vars)) + result.update(self._execute_module(task_vars=task_vars)) + return result try: src = self._find_needle('files', src)