Handle change requests for nonexistent packages
Try to handle the case where we get a change request for a package that does not exist in pkgdb. Gives more complaints than necessary but at least doesn't backtrace.
This commit is contained in:
parent
747b9b91c6
commit
4c3251878d
1 changed files with 8 additions and 1 deletions
|
@ -350,7 +350,12 @@ def change_request_string(items, bug):
|
||||||
def get_pkgdb_owners(pkgdb, pkg):
|
def get_pkgdb_owners(pkgdb, pkg):
|
||||||
owners = {}
|
owners = {}
|
||||||
o = ''
|
o = ''
|
||||||
for i in pkgdb.get_owners(pkg)['packageListings']:
|
try:
|
||||||
|
ownerlist = pkgdb.get_owners(pkg)['packageListings']
|
||||||
|
except AppError, e:
|
||||||
|
return(owners, o)
|
||||||
|
|
||||||
|
for i in ownerlist:
|
||||||
branch = i['collection']['branchname']
|
branch = i['collection']['branchname']
|
||||||
if branch not in branches:
|
if branch not in branches:
|
||||||
continue
|
continue
|
||||||
|
@ -550,6 +555,8 @@ def process_change_request(bug, comment, allcomments, firstfound, pkgdb, branche
|
||||||
(owners, owner_string) = get_pkgdb_owners(pkgdb, items['Package Name'])
|
(owners, owner_string) = get_pkgdb_owners(pkgdb, items['Package Name'])
|
||||||
|
|
||||||
# Try to enforce EPEL branch rules
|
# Try to enforce EPEL branch rules
|
||||||
|
if not len(owners):
|
||||||
|
warnings.append("WARNING: Package does not appear to exist in pkgdb currently.")
|
||||||
for i in owners.keys():
|
for i in owners.keys():
|
||||||
if request['owner'] == owners[i]['primary'] or request['owner'] in owners[i]['comaint']:
|
if request['owner'] == owners[i]['primary'] or request['owner'] in owners[i]['comaint']:
|
||||||
owned = True
|
owned = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue