Skip to content

Commit

Permalink
Merge pull request ansible#1715 from sfromm/issue1713
Browse files Browse the repository at this point in the history
Further tweak how to find pip in virtualenv on centos/redhat/fedora
  • Loading branch information
sfromm committed Dec 2, 2012
2 parents 1e7526e + 5b7c8fc commit a74cae2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions library/pip
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,20 @@ def main():
out += out_venv
err += err_venv

pip = module.get_bin_path('python-pip', False, ['%s/bin' % env])
if not pip:
pip = module.get_bin_path('pip-python', False, ['%s/bin' % env])

# On Debian and Ubuntu, pip is pip.
# On Fedora18 and up, pip is python-pip.
# 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:
pip = module.get_bin_path('pip', True, ['%s/bin' % env])

Expand Down

0 comments on commit a74cae2

Please sign in to comment.