summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2021-01-23 10:39:40 -0800
committerMatt Clay <matt@mystile.com>2021-01-23 12:36:28 -0800
commit1f90c11782c32a0c966ee2ac6ee76a5e3ea81f4a (patch)
tree114f549d6f2d5d65840472b46995ba2052ac976a
parente5b6d2aaae160aa67677e87b01578772c55cf084 (diff)
downloadansible-1f90c11782c32a0c966ee2ac6ee76a5e3ea81f4a.tar.gz
[stable-2.10] Handle get-pip.py breaking change on Python 2.7.
(cherry picked from commit 484e4af4d0b0f8ba88f73c20f592bb107eb9396a) Co-authored-by: Matt Clay <matt@mystile.com>
-rw-r--r--changelogs/fragments/ansible-test-pip-bootstrap.yml2
-rw-r--r--test/lib/ansible_test/_data/setup/remote.sh10
2 files changed, 11 insertions, 1 deletions
diff --git a/changelogs/fragments/ansible-test-pip-bootstrap.yml b/changelogs/fragments/ansible-test-pip-bootstrap.yml
new file mode 100644
index 0000000000..d9322116bf
--- /dev/null
+++ b/changelogs/fragments/ansible-test-pip-bootstrap.yml
@@ -0,0 +1,2 @@
+bugfixes:
+ - ansible-test - The ``--remote`` option has been updated for Python 2.7 to work around breaking changes in the newly released ``get-pip.py`` bootstrapper.
diff --git a/test/lib/ansible_test/_data/setup/remote.sh b/test/lib/ansible_test/_data/setup/remote.sh
index 93dead5d7e..26bec500c0 100644
--- a/test/lib/ansible_test/_data/setup/remote.sh
+++ b/test/lib/ansible_test/_data/setup/remote.sh
@@ -10,7 +10,15 @@ cd ~/
install_pip () {
if ! "${python_interpreter}" -m pip.__main__ --version --disable-pip-version-check 2>/dev/null; then
- curl --silent --show-error https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
+ case "${python_version}" in
+ "2.7")
+ pip_bootstrap_url="https://bootstrap.pypa.io/${python_version}/get-pip.py"
+ ;;
+ *)
+ pip_bootstrap_url="https://bootstrap.pypa.io/get-pip.py"
+ ;;
+ esac
+ curl --silent --show-error "${pip_bootstrap_url}" -o /tmp/get-pip.py
"${python_interpreter}" /tmp/get-pip.py --disable-pip-version-check --quiet
rm /tmp/get-pip.py
fi