mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update states.pkg for Python3 compatibility
This commit is contained in:
parent
2a7d76ad6e
commit
66884334d9
1 changed files with 3 additions and 3 deletions
|
@ -92,7 +92,7 @@ from salt.exceptions import (
|
|||
from salt.modules.pkg_resource import _repack_pkgs
|
||||
|
||||
# Import 3rd-party libs
|
||||
import salt.ext.six as six
|
||||
from salt.ext import six
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
_repack_pkgs = _namespaced_function(_repack_pkgs, globals())
|
||||
|
@ -2846,10 +2846,10 @@ def uptodate(name, refresh=False, pkgs=None, **kwargs):
|
|||
try:
|
||||
packages = __salt__['pkg.list_upgrades'](refresh=refresh, **kwargs)
|
||||
expected = {pkgname: {'new': pkgver, 'old': __salt__['pkg.version'](pkgname)}
|
||||
for pkgname, pkgver in packages.iteritems()}
|
||||
for pkgname, pkgver in six.iteritems(packages)}
|
||||
if isinstance(pkgs, list):
|
||||
packages = [pkg for pkg in packages if pkg in pkgs]
|
||||
expected = {pkgname: pkgver for pkgname, pkgver in expected.iteritems() if pkgname in pkgs}
|
||||
expected = {pkgname: pkgver for pkgname, pkgver in six.iteritems(expected) if pkgname in pkgs}
|
||||
except Exception as exc:
|
||||
ret['comment'] = str(exc)
|
||||
return ret
|
||||
|
|
Loading…
Add table
Reference in a new issue