diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index f4cf69a5..80393c84 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -507,11 +507,6 @@ class Connection(ansible.plugins.connection.ConnectionBase): # we need it to be an object with the value of "_finding_python_interpreter" in case we aren't # running interpreter discovery fully _action = type(str('actionTemp'), (object,), {'_finding_python_interpreter': False}) - # redeclaring interpreter discovery vars here in case running ansible < 2.8.0 - _discovered_interpreter_key = None - _discovered_interpreter = False - _discovery_deprecation_warnings = [] - _discovery_warnings = [] def __del__(self): """ diff --git a/ansible_mitogen/mixins.py b/ansible_mitogen/mixins.py index fd90bb78..7c2d7975 100644 --- a/ansible_mitogen/mixins.py +++ b/ansible_mitogen/mixins.py @@ -116,6 +116,11 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): # required for python interpreter discovery connection.templar = self._templar self._finding_python_interpreter = False + # redeclaring interpreter discovery vars here in case running ansible < 2.8.0 + self._discovered_interpreter_key = None + self._discovered_interpreter = False + self._discovery_deprecation_warnings = [] + self._discovery_warnings = [] def run(self, tmp=None, task_vars=None): """