From 389cee8c70e84e454722fb6367a1b1063b1fca47 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Sun, 15 Mar 2020 11:10:26 -0700 Subject: [PATCH] fix assertion of python_path, it should be always what 'discovered_interpreter' is --- ansible_mitogen/plugins/action/mitogen_get_stack.py | 2 ++ tests/ansible/integration/transport_config/python_path.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible_mitogen/plugins/action/mitogen_get_stack.py b/ansible_mitogen/plugins/action/mitogen_get_stack.py index 171f84ea..0d0afe86 100644 --- a/ansible_mitogen/plugins/action/mitogen_get_stack.py +++ b/ansible_mitogen/plugins/action/mitogen_get_stack.py @@ -52,4 +52,6 @@ class ActionModule(ActionBase): 'changed': True, 'result': stack, '_ansible_verbose_always': True, + # for ansible < 2.8, we'll default to /usr/bin/python like before + 'discovered_interpreter': self._connection._action._discovered_interpreter } diff --git a/tests/ansible/integration/transport_config/python_path.yml b/tests/ansible/integration/transport_config/python_path.yml index 8ee9458e..e42c3b23 100644 --- a/tests/ansible/integration/transport_config/python_path.yml +++ b/tests/ansible/integration/transport_config/python_path.yml @@ -77,7 +77,8 @@ - {mitogen_get_stack: {}, register: out} - assert_equal: left: out.result[0].kwargs.python_path - right: ["/usr/bin/python"] + right: ["{{out.discovered_interpreter}}"] + - hosts: localhost vars: {mitogen_via: tc-python-path-local-unset}