Merge lp:~cr3/checkbox/duplicates into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1474
Proposed branch: lp:~cr3/checkbox/duplicates
Merge into: lp:checkbox
Diff against target: 52 lines (+21/-2)
3 files modified
checkbox/job.py (+15/-1)
debian/changelog (+5/-0)
jobs/suspend.txt.in (+1/-1)
To merge this branch: bzr merge lp:~cr3/checkbox/duplicates
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+112446@code.launchpad.net

Description of the change

First, ran ./bin/checkbox-gtk with one test resulting in 140 files under the store/ directory and no errors in checkbox.log. Second, re-ran ./bin/checkbox-gtk, answered rerun, resulting in 140 files and still no errors.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

The code looks good, and since it seems to have been thoroughly tested, merging. Thanks!a

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox/job.py'
2--- checkbox/job.py 2012-06-20 20:33:09 +0000
3+++ checkbox/job.py 2012-06-27 21:39:20 +0000
4@@ -104,4 +104,18 @@
5 class JobStore(MessageStore):
6 """A job store which stores its jobs in a file system hierarchy."""
7
8- pass
9+ def add(self, job):
10+ # Return if the same job is already in the store
11+ if list(self._find_matching_messages(name=job["name"])):
12+ return
13+
14+ return super(JobStore, self).add(job)
15+
16+ def _find_matching_messages(self, **kwargs):
17+ for filename in self._walk_messages():
18+ message = self._read_message(filename,cache=True)
19+ for key, value in kwargs.items():
20+ if message.get(key) != value:
21+ break
22+ else:
23+ yield filename
24
25=== modified file 'debian/changelog'
26--- debian/changelog 2012-06-27 20:35:27 +0000
27+++ debian/changelog 2012-06-27 21:39:20 +0000
28@@ -3,6 +3,11 @@
29 [Jeff Lane]
30 * New version 0.14.2 for Quantal Quetzal development.
31
32+ [Marc Tardif]
33+ * Fixed duplicate jobs appearing in the store when rerunning jobs.
34+ * jobs/suspend.txt.in: Removed redundant dependencies which confuses
35+ the latest resolver algorithm.
36+
37 -- Jeff Lane <jeff@ubuntu.com> Wed, 27 Jun 2012 16:34:12 -0400
38
39 checkbox (0.14.1) quantal; urgency=low
40
41=== modified file 'jobs/suspend.txt.in'
42--- jobs/suspend.txt.in 2012-06-27 17:04:01 +0000
43+++ jobs/suspend.txt.in 2012-06-27 21:39:20 +0000
44@@ -172,7 +172,7 @@
45
46 plugin: shell
47 name: suspend/wireless_after_suspend
48-depends: suspend/suspend_advanced suspend/wireless_before_suspend
49+depends: suspend/suspend_advanced
50 requires: device.category == 'WIRELESS'
51 command: connect_wireless && internet_test --interface=`nmcli dev list | grep -B 1 wireless | grep GENERAL.DEVICE | awk '{print $2}'` && for con in `cat $CHECKBOX_DATA/connections`; do nmcli con up uuid "$con"; done
52 _description:

Subscribers

People subscribed via source and target branches