diff --git a/Makefile b/Makefile index 8e94d1a1b6..a13ac07f03 100644 --- a/Makefile +++ b/Makefile @@ -134,8 +134,8 @@ virtualenv_ansible_py3: if [ ! -d "$(VENV_BASE)" ]; then \ mkdir $(VENV_BASE); \ fi; \ - if [ ! -d "$(VENV_BASE)/ansible3" ]; then \ - python3 -m venv --system-site-packages $(VENV_BASE)/ansible3; \ + if [ ! -d "$(VENV_BASE)/ansible" ]; then \ + $(PYTHON) -m venv --system-site-packages $(VENV_BASE)/ansible; \ fi; \ fi @@ -145,7 +145,7 @@ virtualenv_awx: mkdir $(VENV_BASE); \ fi; \ if [ ! -d "$(VENV_BASE)/awx" ]; then \ - $(PYTHON) -m venv $(VENV_BASE)/awx; \ + $(PYTHON) -m venv --system-site-packages $(VENV_BASE)/awx; \ fi; \ fi @@ -158,9 +158,9 @@ requirements_ansible: virtualenv_ansible $(VENV_BASE)/ansible/bin/pip uninstall --yes -r requirements/requirements_ansible_uninstall.txt requirements_ansible_py3: virtualenv_ansible_py3 - cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | $(VENV_BASE)/ansible3/bin/pip3 install $(PIP_OPTIONS) --no-binary $(SRC_ONLY_PKGS) --ignore-installed -r /dev/stdin - $(VENV_BASE)/ansible3/bin/pip3 install ansible # can't inherit from system ansible, it's py2 - $(VENV_BASE)/ansible3/bin/pip3 uninstall --yes -r requirements/requirements_ansible_uninstall.txt + cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | $(VENV_BASE)/ansible/bin/pip3 install $(PIP_OPTIONS) --no-binary $(SRC_ONLY_PKGS) --ignore-installed -r /dev/stdin + $(VENV_BASE)/ansible/bin/pip3 install ansible # can't inherit from system ansible, it's py2 + $(VENV_BASE)/ansible/bin/pip3 uninstall --yes -r requirements/requirements_ansible_uninstall.txt requirements_ansible_dev: if [ "$(VENV_BASE)" ]; then \ @@ -189,7 +189,7 @@ requirements_awx_dev: requirements: requirements_ansible requirements_awx -requirements_dev: requirements requirements_ansible_py3 requirements_awx_dev requirements_ansible_dev +requirements_dev: requirements requirements_awx_dev requirements_ansible_dev requirements_test: requirements diff --git a/awx/main/tests/unit/utils/test_common.py b/awx/main/tests/unit/utils/test_common.py index 1f0e464f15..f7e9f68bbc 100644 --- a/awx/main/tests/unit/utils/test_common.py +++ b/awx/main/tests/unit/utils/test_common.py @@ -173,14 +173,12 @@ def test_extract_ansible_vars(): def test_get_custom_venv_choices(): bundled_venv = os.path.join(settings.BASE_VENV_PATH, 'ansible', '') - bundled_venv_py3 = os.path.join(settings.BASE_VENV_PATH, 'ansible3', '') - assert sorted(common.get_custom_venv_choices()) == [bundled_venv, bundled_venv_py3] + assert sorted(common.get_custom_venv_choices()) == [bundled_venv] with TemporaryDirectory(dir=settings.BASE_VENV_PATH, prefix='tmp') as temp_dir: os.makedirs(os.path.join(temp_dir, 'bin', 'activate')) assert sorted(common.get_custom_venv_choices()) == [ bundled_venv, - bundled_venv_py3, os.path.join(temp_dir, '') ] diff --git a/tools/scripts/awx-python b/tools/scripts/awx-python index 776a2473b3..b92f3c5b2a 100755 --- a/tools/scripts/awx-python +++ b/tools/scripts/awx-python @@ -15,4 +15,4 @@ if [ -f /var/lib/awx/venv/awx/bin/activate ]; then fi # Run the requested Python command, using the interpreter from the path -exec python "$@" +exec python3 "$@" diff --git a/tools/scripts/failure-event-handler b/tools/scripts/failure-event-handler index 0be887f951..9838696f1c 100755 --- a/tools/scripts/failure-event-handler +++ b/tools/scripts/failure-event-handler @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import os import signal