summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/backend/yumpkgmgr.py2
-rw-r--r--plugins/backend/zypppkgmgr.py11
2 files changed, 7 insertions, 6 deletions
diff --git a/plugins/backend/yumpkgmgr.py b/plugins/backend/yumpkgmgr.py
index 51d9786..3370fef 100644
--- a/plugins/backend/yumpkgmgr.py
+++ b/plugins/backend/yumpkgmgr.py
@@ -240,7 +240,7 @@ class Yum(BackendPlugin, yum.YumBase):
else:
msger.warning("No such package %s to remove" %(pkg,))
- def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
+ def selectGroup(self, grp, include = ksparser.constants.GROUP_DEFAULT):
try:
yum.YumBase.selectGroup(self, grp)
if include == ksparser.GROUP_REQUIRED:
diff --git a/plugins/backend/zypppkgmgr.py b/plugins/backend/zypppkgmgr.py
index 7822904..b95f9bd 100644
--- a/plugins/backend/zypppkgmgr.py
+++ b/plugins/backend/zypppkgmgr.py
@@ -20,6 +20,7 @@ import shutil
import urllib.parse
import rpm
import glob
+import functools
import zypp #pylint: disable=import-error
if not hasattr(zypp, 'PoolQuery') or \
@@ -226,7 +227,7 @@ class Zypp(BackendPlugin):
for pitem in sorted(
q.queryResults(self.Z.pool()),
- cmp=lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y)),
+ key=functools.cmp_to_key(lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y))),
reverse=True):
item = zypp.asKindPackage(pitem)
if item.name() in list(self.excpkgs.keys()) and \
@@ -254,7 +255,7 @@ class Zypp(BackendPlugin):
for pitem in sorted(
q.queryResults(self.Z.pool()),
- cmp=lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y)),
+ key=functools.cmp_to_key(lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y))),
reverse=True):
item = zypp.asKindPackage(pitem)
if item.name() in list(self.excpkgs.keys()) and \
@@ -303,7 +304,7 @@ class Zypp(BackendPlugin):
"""collect packages should not be installed"""
self.to_deselect.append(pkg)
- def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
+ def selectGroup(self, grp, include = ksparser.constants.GROUP_DEFAULT):
def compareGroup(pitem):
item = zypp.asKindPattern(pitem)
return item.repoInfo().priority()
@@ -734,8 +735,8 @@ class Zypp(BackendPlugin):
for problem in probs:
msger.warning("repo problem: %s, %s" \
- % (problem.description().decode("utf-8"),
- problem.details().decode("utf-8")))
+ % (problem.description(),
+ problem.details()))
raise RepoError("found %d resolver problem, abort!" \
% len(probs))