[stable-2.10] Handle get-pip.py breaking change on Python 2.7.
(cherry picked from commit 484e4af4d0
)
Co-authored-by: Matt Clay <matt@mystile.com>
This commit is contained in:
parent
e5b6d2aaae
commit
1f90c11782
2 changed files with 11 additions and 1 deletions
2
changelogs/fragments/ansible-test-pip-bootstrap.yml
Normal file
2
changelogs/fragments/ansible-test-pip-bootstrap.yml
Normal file
|
@ -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.
|
|
@ -10,7 +10,15 @@ cd ~/
|
||||||
|
|
||||||
install_pip () {
|
install_pip () {
|
||||||
if ! "${python_interpreter}" -m pip.__main__ --version --disable-pip-version-check 2>/dev/null; then
|
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
|
"${python_interpreter}" /tmp/get-pip.py --disable-pip-version-check --quiet
|
||||||
rm /tmp/get-pip.py
|
rm /tmp/get-pip.py
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue