mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
pip.installed: Fix traceback when _find_key doesn't return a match
This commit is contained in:
parent
67b7d285ed
commit
2aaa9f9c95
1 changed files with 5 additions and 6 deletions
|
@ -92,7 +92,7 @@ def _find_key(prefix, pip_list):
|
|||
except StopIteration:
|
||||
return None
|
||||
else:
|
||||
return match
|
||||
return match.lower()
|
||||
|
||||
|
||||
def _fulfills_version_spec(version, version_spec):
|
||||
|
@ -913,11 +913,10 @@ def installed(name,
|
|||
)
|
||||
else:
|
||||
pkg_name = _find_key(prefix, pipsearch)
|
||||
if pkg_name.lower() in already_installed_packages:
|
||||
continue
|
||||
ver = pipsearch[pkg_name]
|
||||
ret['changes']['{0}=={1}'.format(pkg_name,
|
||||
ver)] = 'Installed'
|
||||
if pkg_name is not None \
|
||||
and pkg_name not in already_installed_packages:
|
||||
ver = pipsearch[pkg_name]
|
||||
ret['changes']['{0}=={1}'.format(pkg_name, ver)] = 'Installed'
|
||||
# Case for packages that are an URL
|
||||
else:
|
||||
ret['changes']['{0}==???'.format(state_name)] = 'Installed'
|
||||
|
|
Loading…
Add table
Reference in a new issue