fix pip module for 10.0.0

Fixes #46971
This commit is contained in:
Daniel Wallace 2018-04-17 09:18:48 -05:00
parent 4c07a3d1e9
commit 8497e08f8e
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

View file

@ -798,6 +798,11 @@ def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
# Put the commas back in while making sure the names are contained in
# quotes, this allows for proper version spec passing salt>=0.17.0
cmd.extend(['{0}'.format(p.replace(';', ',')) for p in pkgs])
else:
# Starting with pip 10.0.0, if no packages are specified in the
# command, it returns a retcode 1. So instead of running the command,
# just return the output without running pip.
return {'retcode': 0, 'stdout': 'No packages to install.'}
if editable:
egg_match = re.compile(r'(?:#|#.*?&)egg=([^&]*)')