Merge lp:~brian-murray/errors/sort-versions-in-bucket into lp:errors

Proposed by Brian Murray
Status: Merged
Merged at revision: 180
Proposed branch: lp:~brian-murray/errors/sort-versions-in-bucket
Merge into: lp:errors
Diff against target: 23 lines (+5/-3)
1 file modified
cassandra.py (+5/-3)
To merge this branch: bzr merge lp:~brian-murray/errors/sort-versions-in-bucket
Reviewer Review Type Date Requested Status
Evan (community) Approve
Review via email: mp+122972@code.launchpad.net

Description of the change

Looking at an error page like the following, https://errors.ubuntu.com/bucket/?id=%2Fusr%2Fbin%2Fupdate-manager%3AAptDaemonError%3A_on_clicked%3A_deferable%3A_convert_dbus_exception, I noticed that the package versions are not sorted.

This should fix that.

To post a comment you must log in.
Revision history for this message
Evan (ev) wrote :

Committed with fixes. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cassandra.py'
2--- cassandra.py 2012-09-05 13:46:40 +0000
3+++ cassandra.py 2012-09-05 22:49:22 +0000
4@@ -1,7 +1,8 @@
5+import apt
6+import datetime
7+import pycassa
8 import sys
9 import time
10-import datetime
11-import pycassa
12 from pycassa.cassandra.ttypes import NotFoundException
13 from pycassa.util import OrderedDict
14
15@@ -290,7 +291,8 @@
16
17 def get_versions_for_bucket(bucketid):
18 try:
19- return bucketversions_cf.get(bucketid)
20+ results = bucketversions_cf.get(bucketid)
21+ return sorted(results, cmp=apt.apt_pkg.version_compare)
22 except NotFoundException:
23 return {}
24

Subscribers

People subscribed via source and target branches

to all changes: