Skip to content

Commit

Permalink
Merge pull request #5938 from bclermont/0.16-pip-issue
Browse files Browse the repository at this point in the history
handle gracefully -f (--find-links) in "pip freeze" and report error in ...
  • Loading branch information
techhat committed Jul 4, 2013
2 parents 9a56cc7 + a1f445c commit 1567235
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion salt/modules/pip.py
Expand Up @@ -560,12 +560,18 @@ def list_(prefix='',
raise CommandExecutionError(result['stderr'])

for line in result['stdout'].splitlines():
if line.startswith('-e'):
if line.startswith('-f'):
# ignore -f line as it contains --find-links directory
continue
elif line.startswith('-e'):
line = line.split('-e ')[1]
version, name = line.split('#egg=')
elif len(line.split('==')) >= 2:
name = line.split('==')[0]
version = line.split('==')[1]
else:
logger.error("Can't parse line '%s'", line)
continue

if prefix:
if name.lower().startswith(prefix.lower()):
Expand Down

0 comments on commit 1567235

Please sign in to comment.