Merge lp:~ralsina/ubuntuone-control-panel/decrypt-errors-3-0 into lp:ubuntuone-control-panel/stable-3-0

Proposed by Roberto Alsina on 2012-05-28
Status: Merged
Approved by: dobey on 2012-06-01
Approved revision: 264
Merged at revision: 264
Proposed branch: lp:~ralsina/ubuntuone-control-panel/decrypt-errors-3-0
Merge into: lp:ubuntuone-control-panel/stable-3-0
Diff against target: 59 lines (+21/-0)
3 files modified
ubuntuone/controlpanel/backend.py (+7/-0)
ubuntuone/controlpanel/gui/qt/ubuntuonebin.py (+5/-0)
ubuntuone/controlpanel/tests/test_backend.py (+9/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/decrypt-errors-3-0
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) 2012-05-28 Approve on 2012-06-01
dobey (community) 2012-05-28 Approve on 2012-05-30
Review via email: mp+107671@code.launchpad.net

Commit message

 - Hides cryptic error (Fixes LP:1002377).

Description of the change

Fixes something that only happens on windows, where a failure to start syncdaemon will cause sd_client to be None.

Proposing only for stable-3-0 because in trunk, with endpoints, this is not supposed to happen anymore, but we will still do future windows releases from 3-0

This should not have any effects on Ubuntu.

To post a comment you must log in.
dobey (dobey) :
review: Approve
Manuel de la Peña (mandel) wrote :

A little ugly but works and is not needed in trunk.

review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (68.3 KiB)

The attempt to merge lp:~ralsina/ubuntuone-control-panel/decrypt-errors-3-0 into lp:ubuntuone-control-panel/stable-3-0 failed. Below is the output from the failed tests.

*** Running test suite for ubuntuone/controlpanel ***
ubuntuone.controlpanel.tests.test_replication_client
  ReplicationsTestCase
    test_exclude ... [OK]
    test_exclude_name_in_exclusions ... [OK]
    test_exclude_name_not_in_replications ... [OK]
    test_get_exclusions ... [OK]
    test_get_replications ... [OK]
    test_no_pairing_record ... [OK]
    test_replicate ... [OK]
    test_replicate_name_not_in_exclusions ... [OK]
    test_replicate_name_not_in_replications ... [OK]
ubuntuone.controlpanel.tests
  TestCase
    runTest ... [OK]
ubuntuone.controlpanel.tests.test_backend
  BackendAccountTestCase
    test_account_info ... [OK]
    test_account_info_fails ... [OK]
    test_account_info_fails_with_unauthorized ... [OK]
    test_account_info_with_current_plan ... [OK]
    test_backend_creation ... [OK]
    test_device_is_local ... [OK]
    test_get_token ... [OK]
    test_login_client_is_cached ... [OK]
    test_sd_client_is_cached ... [OK]
    test_shutdown_func ... [OK]
    test_shutdown_func_is_called_on_shutdown ... [OK]
    test_shutdown_func_when_none ... [OK]
  BackendBasicTestCase
    test_backend_creation ... [OK]
    test_device_is_local ... [OK]
    test_get_token ... [OK]
    test_login_client_is_cached ... [OK]
    test_sd_client_is_cached ... [OK]
    test_shutdown_func ... [OK]
    test_shutdown_func_is_called_on_shutdown ... [OK]
    test_shutdown_func_when_none ... [OK]
  BackendCredentialsTestCase
    test_backend_creation ... [OK]
    test_clear_credentials ... [OK]
    test_clear_credentials_invalidates_cached_credentials ... [OK]
    test_credentials_are_cached ... [OK]
    test_device_is_l...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/controlpanel/backend.py'
--- ubuntuone/controlpanel/backend.py 2012-05-18 16:49:05 +0000
+++ ubuntuone/controlpanel/backend.py 2012-05-28 17:58:17 +0000
@@ -106,6 +106,10 @@
106 return inner106 return inner
107107
108108
109class SyncDaemonException(Exception):
110 """A problem instantiating SyncDaemonClient."""
111
112
109class ControlBackend(object):113class ControlBackend(object):
110 """The control panel backend."""114 """The control panel backend."""
111115
@@ -135,6 +139,9 @@
135139
136 self.login_client = CredentialsManagementTool()140 self.login_client = CredentialsManagementTool()
137 self.sd_client = sd_client.SyncDaemonClient()141 self.sd_client = sd_client.SyncDaemonClient()
142 if self.sd_client is None:
143 # Probably syncdaemon is not starting
144 raise SyncDaemonException("Error creating SyncDaemonClient.")
138 self.wc = WebClient(self.get_credentials)145 self.wc = WebClient(self.get_credentials)
139146
140 logger.info('ControlBackend: instance started.')147 logger.info('ControlBackend: instance started.')
141148
=== modified file 'ubuntuone/controlpanel/gui/qt/ubuntuonebin.py'
--- ubuntuone/controlpanel/gui/qt/ubuntuonebin.py 2012-02-29 17:39:03 +0000
+++ ubuntuone/controlpanel/gui/qt/ubuntuonebin.py 2012-05-28 17:58:17 +0000
@@ -51,6 +51,11 @@
51 error_handler=self._error_handler)51 error_handler=self._error_handler)
52 self.load = handler(self.load)52 self.load = handler(self.load)
5353
54 # Ensure we load the backend here, so it shows an error if needed
55 # pylint: disable=W0104
56 self.backend
57 # pylint: enable=W0104
58
54 self._setup()59 self._setup()
5560
56 def _get_is_processing(self):61 def _get_is_processing(self):
5762
=== modified file 'ubuntuone/controlpanel/tests/test_backend.py'
--- ubuntuone/controlpanel/tests/test_backend.py 2012-05-18 16:49:05 +0000
+++ ubuntuone/controlpanel/tests/test_backend.py 2012-05-28 17:58:17 +0000
@@ -361,6 +361,15 @@
361 raise ValueError(args)361 raise ValueError(args)
362362
363363
364class SDClientFailureTestCase(TestCase):
365 """Test behaviour in class of sd_client instantiation failure."""
366
367 def test_sd_client_is_none(self):
368 """A failing SyncDaemonClient should trigger exception."""
369 self.patch(backend.sd_client, "SyncDaemonClient", lambda: None)
370 self.assertRaises(backend.SyncDaemonException, backend.ControlBackend)
371
372
364class BackendBasicTestCase(TestCase):373class BackendBasicTestCase(TestCase):
365 """Simple tests for the backend."""374 """Simple tests for the backend."""
366375

Subscribers

People subscribed via source and target branches