Merge lp:~dobey/ubuntuone-client/fix-657850-stable into lp:ubuntuone-client/stable-1-4

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 744
Merged at revision: 743
Proposed branch: lp:~dobey/ubuntuone-client/fix-657850-stable
Merge into: lp:ubuntuone-client/stable-1-4
Diff against target: 37 lines (+13/-5)
1 file modified
bin/ubuntuone-preferences (+13/-5)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/fix-657850-stable
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Roman Yepishev (community) fieldtest Approve
Review via email: mp+43977@code.launchpad.net

Commit message

Handle the case when replication is not available but desktopcouch is installed

To post a comment you must log in.
Revision history for this message
Roman Yepishev (rye) wrote :

Works great, the services checkboxes are disabled and info is shown properly even if paired_server record is missing in management db.

review: Approve (fieldtest)
Revision history for this message
Natalia Bidart (nataliabidart) :
review: Approve
744. By dobey

Fix the lint issue and log the ValueError

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-preferences'
2--- bin/ubuntuone-preferences 2010-09-21 21:29:07 +0000
3+++ bin/ubuntuone-preferences 2011-01-06 15:52:05 +0000
4@@ -702,9 +702,14 @@
5 def connect_desktopcouch_exclusion(self):
6 """Hook up to desktopcouch enablement API, or disable the UI."""
7 # Hook up to desktopcouch, or die trying
8- if dcouch:
9+ try:
10+ if not dcouch:
11+ raise ValueError('Replication service not available.')
12+
13+ # Check bindwood availability
14 Thread(target=self.__check_for_bindwood).start()
15
16+ # Get the exclusion settings
17 self.dcouch = dcouch.ReplicationExclusion()
18 exclusions = self.dcouch.all_exclusions()
19 for check in [self.bookmarks_check,
20@@ -714,10 +719,13 @@
21 check.set_active(False)
22 else:
23 check.set_active(True)
24- else:
25- self.bookmarks_check.set_sensitive(False)
26- self.abook_check.set_sensitive(False)
27- self.gwib_check.set_sensitive(False)
28+ except ValueError, e:
29+ # Replication is not avaialble, so disable the UI
30+ for check in [self.bookmarks_check,
31+ self.abook_check,
32+ self.gwib_check]:
33+ check.set_sensitive(False)
34+ logger.error(e)
35
36 def toggle_db_sync(self, dbname, disable=False):
37 """

Subscribers

People subscribed via source and target branches

to all changes: