handle possible private bugs in the graph
Apparently people are marking public openstack bugs private some times. In these cases we have to handle the possibility that looking for the bug returns a keyerror, and move on gracefully. Change-Id: Icc30843bcc9cfc6822dc7791959c1d2b45765e01
This commit is contained in:
parent
fa8c530f95
commit
3a7e95de47
@ -39,13 +39,18 @@ def get_launchpad_bug(bug):
|
||||
lp = launchpad.Launchpad.login_anonymously('grabbing bugs',
|
||||
'production',
|
||||
LPCACHEDIR)
|
||||
lp_bug = lp.bugs[bug]
|
||||
bugdata = {'name': lp_bug.title}
|
||||
projects = ", ".join(map(lambda x: "(%s - %s)" %
|
||||
(x.bug_target_name, x.status),
|
||||
lp_bug.bug_tasks))
|
||||
bugdata['affects'] = projects
|
||||
bugdata['reviews'] = get_open_reviews(bug)
|
||||
try:
|
||||
lp_bug = lp.bugs[bug]
|
||||
bugdata = {'name': lp_bug.title}
|
||||
projects = ", ".join(map(lambda x: "(%s - %s)" %
|
||||
(x.bug_target_name, x.status),
|
||||
lp_bug.bug_tasks))
|
||||
bugdata['affects'] = projects
|
||||
bugdata['reviews'] = get_open_reviews(bug)
|
||||
except KeyError:
|
||||
# if someone makes a bug private, we lose access to it.
|
||||
bugdata = dict(name='Unknown (Private Bug)',
|
||||
affects='Unknown (Private Bug)', reviews=[])
|
||||
return bugdata
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user