Merge pull request #27996 from rallytime/fix-21845

Don't fail if pip package is already present and pip1 is installed
This commit is contained in:
Mike Place 2015-10-19 06:59:17 -06:00
commit d4604fdb26

View file

@ -673,7 +673,12 @@ def installed(name,
use_vt=use_vt
)
if pip_install_call and (pip_install_call.get('retcode', 1) == 0):
# Check the retcode for success, but don't fail if using pip1 and the package is
# already present. Pip1 returns a retcode of 1 (instead of 0 for pip2) if you run
# "pip install" without any arguments. See issue #21845.
if pip_install_call and \
(pip_install_call.get('retcode', 1) == 0 or pip_install_call.get('stdout', '').startswith(
'You must give at least one requirement to install')):
ret['result'] = True
if requirements or editable: