Merge lp:~barry/ubuntu-system-image/snappy-lp1412698 into lp:~snappy-dev/ubuntu-system-image/ppa-upload

Proposed by Barry Warsaw
Status: Merged
Merged at revision: 304
Proposed branch: lp:~barry/ubuntu-system-image/snappy-lp1412698
Merge into: lp:~snappy-dev/ubuntu-system-image/ppa-upload
Diff against target: 62 lines (+36/-0)
3 files modified
debian/changelog (+8/-0)
systemimage/dbus.py (+8/-0)
systemimage/tests/test_dbus.py (+20/-0)
To merge this branch: bzr merge lp:~barry/ubuntu-system-image/snappy-lp1412698
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+247047@code.launchpad.net

Description of the change

system-image (2.5-0ubuntu1+ppa16) UNRELEASED; urgency=medium

  * Invalidate the update cache and release the checking lock if acquired,
    when the D-Bus method ReloadConfiguration() is called. This ensures
    that another full check will be performed. (LP: #1412698)

 -- Barry Warsaw <email address hidden> Tue, 20 Jan 2015 11:06:51 -0500

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, LGTM!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-01-14 23:39:42 +0000
3+++ debian/changelog 2015-01-20 17:10:06 +0000
4@@ -1,3 +1,11 @@
5+system-image (2.5-0ubuntu1+ppa16) UNRELEASED; urgency=medium
6+
7+ * Invalidate the update cache and release the checking lock if acquired,
8+ when the D-Bus method ReloadConfiguration() is called. This ensures
9+ that another full check will be performed. (LP: #1412698)
10+
11+ -- Barry Warsaw <barry@ubuntu.com> Tue, 20 Jan 2015 11:06:51 -0500
12+
13 system-image (2.5-0ubuntu1+ppa15) vivid; urgency=medium
14
15 [ Barry Warsaw ]
16
17=== modified file 'systemimage/dbus.py'
18--- systemimage/dbus.py 2015-01-14 21:47:31 +0000
19+++ systemimage/dbus.py 2015-01-20 17:10:06 +0000
20@@ -416,6 +416,14 @@
21 config.load(path)
22 except OSError as error:
23 return str(error)
24+ # Invalidate the update cache and release the checking lock if
25+ # acquired. It's fine if the lock is not acquired; it just means that
26+ # no previous CheckForUpdate was called.
27+ self._update = None
28+ try:
29+ self._checking.release()
30+ except RuntimeError:
31+ pass
32 try:
33 # This can legitimately fail if there's no channel.ini file.
34 channel_ini = os.path.join(
35
36=== modified file 'systemimage/tests/test_dbus.py'
37--- systemimage/tests/test_dbus.py 2015-01-14 21:38:17 +0000
38+++ systemimage/tests/test_dbus.py 2015-01-20 17:10:06 +0000
39@@ -1962,3 +1962,23 @@
40 self.assertEqual(status, '')
41 response = self.iface.Information()
42 self.assertEqual(response['current_build_number'], '1833')
43+
44+ def test_check_for_update_after_reload(self):
45+ # LP: #1412698 - Do a CheckForUpdate while in manual download mode,
46+ # which acquires the checking lock. Then ReloadConfiguration and issue
47+ # another CFU. The second one will never send the UAS because the
48+ # checking lock will not be released, until mvo's patch in that bug
49+ # explicitly releases the lock. It doesn't even matter if it actually
50+ # uses a second partition.
51+ self.download_manually()
52+ reactor = SignalCapturingReactor('UpdateAvailableStatus')
53+ reactor.run(self.iface.CheckForUpdate)
54+ self.assertEqual(len(reactor.signals), 1)
55+ self.assertTrue(reactor.signals[0].is_available)
56+ status = self.iface.ReloadConfiguration(
57+ SystemImagePlugin.controller.ini_path)
58+ self.assertEqual(status, '')
59+ reactor = SignalCapturingReactor('UpdateAvailableStatus')
60+ reactor.run(self.iface.CheckForUpdate)
61+ self.assertEqual(len(reactor.signals), 1)
62+ self.assertTrue(reactor.signals[0].is_available)

Subscribers

People subscribed via source and target branches