summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2014-05-22 19:37:13 +0200
committerTill Maas <opensource@till.name>2014-05-22 19:37:13 +0200
commit1417e9e2b5b49d7d8f456603bee8e650c5a36f15 (patch)
treeeebb7bdc1b618a37a1f61b0511592012997947d6
parent00a7634802af669849e02580fd4220a80ad44fe9 (diff)
downloadcnucnu-1417e9e2b5b49d7d8f456603bee8e650c5a36f15.zip
cnucnu-1417e9e2b5b49d7d8f456603bee8e650c5a36f15.tar.gz
cnucnu-1417e9e2b5b49d7d8f456603bee8e650c5a36f15.tar.xz
package_list: Adjust to pkgdb2
-rwxr-xr-xcnucnu/package_list.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/cnucnu/package_list.py b/cnucnu/package_list.py
index 2cc23e4..402f1a1 100755
--- a/cnucnu/package_list.py
+++ b/cnucnu/package_list.py
@@ -32,7 +32,7 @@ import subprocess
#extra modules
import pycurl
-from fedora.client.pkgdb import PackageDB
+import pkgdb2client
# cnucnu modules
import cnucnu
@@ -349,12 +349,17 @@ class PackageList:
@property
def ignore_packages(self):
if self._ignore_packages is None:
- pdb = PackageDB(retries=5)
+ pkgdb = pkgdb2client.PkgDB()
ignore_packages = []
for owner in self.ignore_owners:
- pkgs = pdb.user_packages(owner, acls="owner")["pkgs"]
- p_names = [p["name"] for p in pkgs]
- ignore_packages.extend(p_names)
+ try:
+ # raises PkgDBException if owner is no point of contact for
+ # any package
+ pkgs = pkgdb.get_packages(poc=owner)["packages"]
+ p_names = [p["name"] for p in pkgs]
+ ignore_packages.extend(p_names)
+ except pkgdb2client.PkgDBException:
+ pass
ignore_packages = set(ignore_packages)
self._ignore_packages = ignore_packages
return self._ignore_packages