mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #7237 from hulu/avoid-pip-shadowing
avoid shadowing `version()` in pip.list_()
This commit is contained in:
commit
302e317542
@ -771,19 +771,19 @@ def list_(prefix=None,
|
||||
continue
|
||||
elif line.startswith('-e'):
|
||||
line = line.split('-e ')[1]
|
||||
version, name = line.split('#egg=')
|
||||
version_, name = line.split('#egg=')
|
||||
elif len(line.split('==')) >= 2:
|
||||
name = line.split('==')[0]
|
||||
version = line.split('==')[1]
|
||||
version_ = line.split('==')[1]
|
||||
else:
|
||||
logger.error("Can't parse line '%s'", line)
|
||||
continue
|
||||
|
||||
if prefix:
|
||||
if name.lower().startswith(prefix.lower()):
|
||||
packages[name] = version
|
||||
packages[name] = version_
|
||||
else:
|
||||
packages[name] = version
|
||||
packages[name] = version_
|
||||
return packages
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user