From 26cc0f27245642d55948e4985f86cb821dffe04a Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 4 Apr 2018 20:19:46 +0100 Subject: [PATCH] issue #164: fix remote_tmp handling on <2.5 --- .travis/ansible_tests.sh | 2 +- ansible_mitogen/mixins.py | 4 ++-- tests/ansible/integration/runner__remote_tmp.yml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis/ansible_tests.sh b/.travis/ansible_tests.sh index 89f99cf7..4fc69891 100755 --- a/.travis/ansible_tests.sh +++ b/.travis/ansible_tests.sh @@ -21,7 +21,7 @@ echo travis_fold:end:docker_setup echo travis_fold:start:job_setup -pip install -U ansible==${ANSIBLE_VERSION}" +pip install -U ansible=="${ANSIBLE_VERSION}" cd ${TRAVIS_BUILD_DIR}/tests/ansible cat >> ${TMPDIR}/hosts <<-EOF diff --git a/ansible_mitogen/mixins.py b/ansible_mitogen/mixins.py index 094c4510..f2b8aedc 100644 --- a/ansible_mitogen/mixins.py +++ b/ansible_mitogen/mixins.py @@ -39,6 +39,7 @@ from ansible.module_utils._text import to_bytes from ansible.parsing.utils.jsonify import jsonify import ansible +import ansible.constants import ansible.plugins import ansible.plugins.action @@ -184,8 +185,7 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): try: s = self._connection._shell.get_option('remote_tmp') except AttributeError: - # Required for <2.4.x. - s = '~/.ansible' + s = ansible.constants.DEFAULT_REMOTE_TMP # <=2.4.x return self._remote_expand_user(s) diff --git a/tests/ansible/integration/runner__remote_tmp.yml b/tests/ansible/integration/runner__remote_tmp.yml index 74f18480..47c55b99 100644 --- a/tests/ansible/integration/runner__remote_tmp.yml +++ b/tests/ansible/integration/runner__remote_tmp.yml @@ -6,7 +6,8 @@ - hosts: all gather_facts: true tasks: - - bash_return_paths: + - name: integration/runner__remote_tmp.yml + bash_return_paths: register: output - assert: