Fix remaining pylint issues.

This commit is contained in:
Guy Martin 2018-07-19 13:37:06 +02:00
parent 158ea87407
commit 4b82ab4a9c

View File

@ -50,6 +50,7 @@ import salt.utils.pkg
from salt.exceptions import CommandExecutionError
from salt.ext import six
from salt.ext.six.moves import zip # pylint: disable=redefined-builtin
from functools import reduce
# Define the module's virtual name
__virtualname__ = 'pkg'
@ -313,7 +314,7 @@ def version(*names, **kwargs):
ret[_ips_get_pkgname(line)] = _ips_get_pkgversion(line)
# Append package names which are not installed/found
unmatched = list(filter(lambda name: not reduce(lambda x, y: x or name in y, ret, False), names))
unmatched = list([name for name in names if not reduce(lambda x, y: x or name in y, ret, False)])
ret.update(zip(unmatched, itertools.cycle(('',))))
# Return a string if only one package name passed
@ -372,7 +373,7 @@ def latest_version(*names, **kwargs):
ret[name] = ''
# Append package names which are not found
unmatched = list(filter(lambda name: not reduce(lambda x, y: x or name in y, ret, False), names))
unmatched = list([name for name in names if not reduce(lambda x, y: x or name in y, ret, False)])
ret.update(zip(unmatched, itertools.cycle(('',))))
# Return a string if only one package name passed