mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #1715 from sfromm/issue1713
Further tweak how to find pip in virtualenv on centos/redhat/fedora
This commit is contained in:
commit
a74cae208d
1 changed files with 13 additions and 3 deletions
16
library/pip
16
library/pip
|
@ -153,10 +153,20 @@ def main():
|
||||||
out += out_venv
|
out += out_venv
|
||||||
err += err_venv
|
err += err_venv
|
||||||
|
|
||||||
pip = module.get_bin_path('python-pip', False, ['%s/bin' % env])
|
# On Debian and Ubuntu, pip is pip.
|
||||||
if not pip:
|
# On Fedora18 and up, pip is python-pip.
|
||||||
pip = module.get_bin_path('pip-python', False, ['%s/bin' % env])
|
# On Fedora17 and below, CentOS and RedHat 6 and 5, pip is pip-python.
|
||||||
|
# On Fedora, CentOS, and RedHat, the exception is in the virtualenv.
|
||||||
|
# There, pip is just pip.
|
||||||
|
# Try pip with the virtualenv directory first.
|
||||||
|
pip = module.get_bin_path('pip', False, ['%s/bin' % env])
|
||||||
|
|
||||||
|
for p in ['python-pip', 'pip-python']:
|
||||||
|
if not pip:
|
||||||
|
pip = module.get_bin_path(p, False, ['%s/bin' % env])
|
||||||
|
|
||||||
|
# pip should have been found by now. The final call to get_bin_path
|
||||||
|
# will trigger fail_json.
|
||||||
if not pip:
|
if not pip:
|
||||||
pip = module.get_bin_path('pip', True, ['%s/bin' % env])
|
pip = module.get_bin_path('pip', True, ['%s/bin' % env])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue