From c482104cda555da8730079d67ec05a288830c8e1 Mon Sep 17 00:00:00 2001 From: Maxim Burgerhout Date: Sun, 14 Oct 2012 12:14:59 +0200 Subject: [PATCH] Test for python-pip as well as pip On Red Hat, CentOS and Fedora systems, the pip binary will be called python-pip instead of pip. This commit makes the pip module also check for python-pip. The reason we check for python-pip *first*, is to have ansible fail on not finding 'pip' and reporting *that*. This is consistent with current behaviour and will not confuse users of Debian et al., where the 'python-pip' binary never exists. Tested on Fedora 18 and Ubuntu 12.04. --- pip | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pip b/pip index ec3a4731210..1696fc883e0 100755 --- a/pip +++ b/pip @@ -135,7 +135,9 @@ def main(): out += out_venv err += err_venv - pip = module.get_bin_path('pip', True, ['%s/bin' % env]) + pip = module.get_bin_path('python-pip', False, ['%s/bin' % env]) + if not pip: + pip = module.get_bin_path('pip', True, ['%s/bin' % env]) state = module.params['state'] name = module.params['name']