mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Updated pip_state to work with pip 8.0 on 2015.8
This commit is contained in:
parent
13add7d142
commit
9cb17332fa
@ -47,6 +47,14 @@ if HAS_PIP is True:
|
||||
del pip
|
||||
if 'pip' in sys.modules:
|
||||
del sys.modules['pip']
|
||||
|
||||
ver = pip.__version__.split('.')
|
||||
pip_ver = tuple([int(x) for x in ver if x.isdigit()])
|
||||
if pip_ver >= (8, 0, 0):
|
||||
from pip.exceptions import InstallationError
|
||||
else:
|
||||
InstallationError = ValueError
|
||||
|
||||
# pylint: enable=import-error
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -135,7 +143,7 @@ def _check_pkg_version_format(pkg):
|
||||
break
|
||||
else:
|
||||
install_req = pip.req.InstallRequirement.from_line(pkg)
|
||||
except ValueError as exc:
|
||||
except (ValueError, InstallationError) as exc:
|
||||
ret['result'] = False
|
||||
if not from_vcs and '=' in pkg and '==' not in pkg:
|
||||
ret['comment'] = (
|
||||
|
Loading…
Reference in New Issue
Block a user