Don't fail if pip package is already present and pip1 is installed

Refs #21845
This commit is contained in:
rallytime 2015-10-15 15:11:21 -06:00
parent 831ec680d9
commit f9406b5828

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: