5
5
import getopt, re, sys
7
7
from launchpadlib.launchpad import Launchpad
8
from lazr.restfulclient import errors
10
9
print "Please install launchpadlib from lp:launchpadlib"
15
print "Please install hydrazine from lp:hydrazine"
19
12
options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
20
13
options = dict(options)
30
23
def report_notmarked(bug, task, section):
32
25
print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.id, )
33
26
print "Launchpad title: %s" % bug.title
34
27
print "NEWS summary: "
71
def print_bug_url(bugno):
72
print '<URL:http://pad.lv/%s>' % (bugno,)
64
lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
74
launchpad = hydrazine.create_session()
75
66
bugnos = read_news_bugnos(args[1])
76
67
for bugno, section in bugnos:
78
bug = launchpad.bugs[bugno]
79
except errors.HTTPError, e:
80
if e.response.status == 401:
82
# Private, we can't access the bug content
83
print '%s is private and cannot be accessed' % (bugno,)
89
70
for task in bug.bug_tasks:
90
parts = task.bug_target_name.split('/')
96
distribution = parts[1]
71
if task.bug_target_name == "bzr":
99
if not fix_released and task.status == "Fix Released":
100
# We could check that the NEWS section and task_status are in
101
# sync, but that would be overkill. (case at hand: bug #416732)
73
if task.status != "Fix Released":
74
report_notmarked(bug, task, section)
106
76
print "Bug %d was mentioned in NEWS but is not marked as affecting bzr" % bugno
107
elif not fix_released:
109
report_notmarked(bug, task, section)