summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorMichael Scherer <mscherer@users.noreply.github.com>2016-09-03 19:21:22 +0200
committerMatt Clay <matt@mystile.com>2016-09-03 10:21:22 -0700
commit918d1e038e0ec718b0b36adda294fa2e876f307b (patch)
treed5b1555223cdae639ef8771f0b90f0367e3eb1ea /test/integration
parent4ae59b2743c0466a67bfc745ae081139211ecf15 (diff)
downloadansible-918d1e038e0ec718b0b36adda294fa2e876f307b.tar.gz
Do not hardcode python executable in test (#17380)
Based on https://github.com/ansible/ansible/pull/17376
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/roles/setup_ec2/tasks/main.yml2
-rw-r--r--test/integration/roles/test_get_url/tasks/main.yml2
-rw-r--r--test/integration/roles/test_pip/tasks/main.yml4
-rw-r--r--test/integration/roles/test_template/tasks/main.yml2
-rw-r--r--test/integration/roles/test_until/tasks/main.yml2
5 files changed, 6 insertions, 6 deletions
diff --git a/test/integration/roles/setup_ec2/tasks/main.yml b/test/integration/roles/setup_ec2/tasks/main.yml
index 7e80677def..a41ce0963e 100644
--- a/test/integration/roles/setup_ec2/tasks/main.yml
+++ b/test/integration/roles/setup_ec2/tasks/main.yml
@@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- name: generate random string
- command: python -c "import string,random; print ''.join(random.choice(string.ascii_lowercase) for _ in range(8));"
+ command: '{{ ansible_python.executable }} -c "import string,random; print ''.join(random.choice(string.ascii_lowercase) for _ in range(8));"'
register: random_string
tags:
- prepare
diff --git a/test/integration/roles/test_get_url/tasks/main.yml b/test/integration/roles/test_get_url/tasks/main.yml
index a601ef1e99..e19ec8ab4a 100644
--- a/test/integration/roles/test_get_url/tasks/main.yml
+++ b/test/integration/roles/test_get_url/tasks/main.yml
@@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- name: Determine if python looks like it will support modern ssl features like SNI
- command: python -c 'from ssl import SSLContext'
+ command: "{{ ansible_python.executable }} -c 'from ssl import SSLContext'"
ignore_errors: True
register: python_test
diff --git a/test/integration/roles/test_pip/tasks/main.yml b/test/integration/roles/test_pip/tasks/main.yml
index 6b1597dd8b..b95c52c435 100644
--- a/test/integration/roles/test_pip/tasks/main.yml
+++ b/test/integration/roles/test_pip/tasks/main.yml
@@ -37,7 +37,7 @@
that:
- "not uninstall_result.changed"
-- shell: "python -c 'import {{ pip_test_package }}'"
+- shell: "{{ ansible_python.executable }} -c 'import {{ pip_test_package }}'"
register: absent_result
ignore_errors: True
@@ -58,7 +58,7 @@
that:
- "install_result.changed == True"
-- shell: "python -c 'import {{ pip_test_package }}'"
+- shell: "{{ ansible_python.executable }} -c 'import {{ pip_test_package }}'"
register: installed_result
# now remove it to test uninstallation of a package we are sure is installed
diff --git a/test/integration/roles/test_template/tasks/main.yml b/test/integration/roles/test_template/tasks/main.yml
index f29d8b474c..133690ff05 100644
--- a/test/integration/roles/test_template/tasks/main.yml
+++ b/test/integration/roles/test_template/tasks/main.yml
@@ -42,7 +42,7 @@
# VERIFY CONTENTS
- name: check what python version ansible is running on
- command: python -c 'import distutils.sysconfig ; print(distutils.sysconfig.get_python_version())'
+ command: "{{ ansible_python.executable }} -c 'import distutils.sysconfig ; print(distutils.sysconfig.get_python_version())'"
register: pyver
delegate_to: localhost
diff --git a/test/integration/roles/test_until/tasks/main.yml b/test/integration/roles/test_until/tasks/main.yml
index b0e0c5d233..74a214756d 100644
--- a/test/integration/roles/test_until/tasks/main.yml
+++ b/test/integration/roles/test_until/tasks/main.yml
@@ -1,4 +1,4 @@
-- shell: python -c "import tempfile; print(tempfile.mkstemp()[1])"
+- shell: '{{ ansible_python.executable }} -c "import tempfile; print(tempfile.mkstemp()[1])"'
register: tempfilepath
- set_fact: