bodhi/controllers.py | 14 ++++++++++++++
bodhi/tools/client.py | 15 +++++++++++++++
2 files changed, 29 insertions(+)
New commits:
commit 258aff7c899de01c863a3e03c52b39d0c0294b20
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 3 11:13:18 2010 -0500
Add a --critpath option to the bodhi CLI
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index d4b3677..fe1d8bf 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -86,6 +86,10 @@ def get_parser():
parser.add_option("-D", "--download", action="store",
dest="download",
metavar="UPDATE", help="Download an update")
+ parser.add_option("", "--critpath",
action="store_true",
+ help="Display a list of pending critical path updates",
+ dest="critpath")
+
## Details
parser.add_option("-s", "--status", action="store",
type="string",
dest="status", help="List
[pending|testing|stable|"
@@ -106,6 +110,7 @@ def get_parser():
parser.add_option("-L", "--latest", action="store",
type="string",
dest="latest", help="List the latest builds of a
"
"specific package across all releases")
+
## Output
parser.add_option("-v", "--verbose",
action="store_true", dest="verbose",
help="Show debugging messages")
@@ -303,6 +308,16 @@ def main():
for dist, build in data:
log.info('%26s %s' % (dist, build))
+ elif opts.critpath:
+ log.info("Getting a list of critical path updates...")
+ data = bodhi.send_request('critpath')
+ if data['tg_flash']:
+ log.info(data['tg_flash'])
+ for update in data['updates']:
+ log.info(bodhi.update_str(update, minimal=not opts.verbose))
+ log.info("%d pending critical path updates found" % (
+ len(data['updates'])))
+
elif opts.mine and not args:
data = bodhi.query(mine=opts.mine)
for update in data['updates']:
commit eb88da77bb7f67fa5aaa596abeb055b5017f0b9d
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 3 11:12:45 2010 -0500
Add a critpath method to our RootController
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 85f2a29..92cdc19 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1261,3 +1261,17 @@ class Root(controllers.RootController):
for build in koji.getLatestBuilds(tag, package=package):
builds[tag] = build['nvr']
return builds
+
+ @expose(template='bodhi.templates.list', allow_json=True)
+ @paginate('updates', limit=1000, max_limit=1000)
+ def critpath(self, *args, **kw):
+ updates = []
+ releases = Release.select(Release.q.locked==True)
+ for update in PackageUpdate.select(
+ AND(PackageUpdate.q.status != 'stable',
+ OR(*[PackageUpdate.q.releaseID == release.id
+ for release in releases]))):
+ if update.critpath:
+ updates.append(update)
+ return dict(updates=updates, num_items=len(updates),
+ title='Critical Path Updates')
Show replies by date