mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
blast, put the try/except int he right place
This commit is contained in:
parent
081e6c5b83
commit
1d8b289db1
@ -155,10 +155,6 @@ def _check_pkg_version_format(pkg):
|
||||
)
|
||||
)
|
||||
return ret
|
||||
try:
|
||||
ret['prefix'] = install_req.req.project_name
|
||||
ret['version_spec'] = install_req.req.specs
|
||||
except Exception:
|
||||
if install_req.req is None:
|
||||
# This is most likely an url and there's no way to know what will
|
||||
# be installed before actually installing it.
|
||||
@ -167,6 +163,10 @@ def _check_pkg_version_format(pkg):
|
||||
ret['version_spec'] = []
|
||||
else:
|
||||
ret['result'] = True
|
||||
try:
|
||||
ret['prefix'] = install_req.req.project_name
|
||||
ret['version_spec'] = install_req.req.specs
|
||||
except Exception:
|
||||
ret['prefix'] = re.sub('[^A-Za-z0-9.]+', '-', install_req.name)
|
||||
if hasattr(install_req, "specifier"):
|
||||
specifier = install_req.specifier
|
||||
|
Loading…
Reference in New Issue
Block a user