From ee310c1a680967ba9ae85274f44c5df871c7b76d Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Tue, 11 Feb 2020 18:08:02 -0800 Subject: [PATCH] remove_internal_keys returns None, so need different way to check fallback --- ansible_mitogen/mixins.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible_mitogen/mixins.py b/ansible_mitogen/mixins.py index a6f4ec6f..c3c7af80 100644 --- a/ansible_mitogen/mixins.py +++ b/ansible_mitogen/mixins.py @@ -69,7 +69,7 @@ except ImportError: except ImportError: # ansible 2.3.3 has remove_internal_keys as a protected func on the action class # we'll fallback to calling self._remove_internal_keys in this case - remove_internal_keys = lambda a: None + remove_internal_keys = lambda a: "Not found" LOG = logging.getLogger(__name__) @@ -392,7 +392,9 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): # prevents things like discovered_interpreter_* or ansible_discovered_interpreter_* from being set # handle ansible 2.3.3 that has remove_internal_keys in a different place - remove_internal_keys(result) or self._remove_internal_keys(result) + check = remove_internal_keys(result) + if check == 'Not found': + self._remove_internal_keys(result) # taken from _execute_module of ansible 2.8.6 # propagate interpreter discovery results back to the controller