mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Pip fix (#33180)
* fix pip!! * make it work with old pip as well * Added resiliency * Don't need to check, just get the right name
This commit is contained in:
parent
43288b268d
commit
264ad34b3b
@ -21,6 +21,7 @@ requisite to a pkg.installed state for the package which provides pip
|
|||||||
|
|
||||||
# Import python libs
|
# Import python libs
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
import re
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
@ -163,8 +164,12 @@ def _check_pkg_version_format(pkg):
|
|||||||
ret['version_spec'] = []
|
ret['version_spec'] = []
|
||||||
else:
|
else:
|
||||||
ret['result'] = True
|
ret['result'] = True
|
||||||
ret['prefix'] = install_req.req.project_name
|
ret['prefix'] = re.sub('[^A-Za-z0-9.]+', '-', install_req.name)
|
||||||
ret['version_spec'] = install_req.req.specs
|
if hasattr(install_req, "specifier"):
|
||||||
|
specifier = install_req.specifier
|
||||||
|
else:
|
||||||
|
specifier = install_req.req.specifier
|
||||||
|
ret['version_spec'] = [(spec.operator, spec.version) for spec in specifier]
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user