Merge lp://qastaging/~nataliabidart/ubuntuone-control-panel/handle-sd-timeout into lp://qastaging/ubuntuone-control-panel

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 28
Merged at revision: 27
Proposed branch: lp://qastaging/~nataliabidart/ubuntuone-control-panel/handle-sd-timeout
Merge into: lp://qastaging/ubuntuone-control-panel
Diff against target: 941 lines (+309/-136)
17 files modified
ubuntuone/controlpanel/backend.py (+1/-0)
ubuntuone/controlpanel/dbus_client.py (+8/-0)
ubuntuone/controlpanel/dbus_service.py (+66/-10)
ubuntuone/controlpanel/gtk/tests/__init__.py (+0/-16)
ubuntuone/controlpanel/gtk/tests/test_gui.py (+2/-3)
ubuntuone/controlpanel/gtk/tests/test_widgets.py (+7/-6)
ubuntuone/controlpanel/gtk/widgets.py (+1/-0)
ubuntuone/controlpanel/integrationtests/__init__.py (+1/-0)
ubuntuone/controlpanel/integrationtests/test_dbus_client_sso.py (+1/-0)
ubuntuone/controlpanel/integrationtests/test_dbus_service.py (+82/-4)
ubuntuone/controlpanel/integrationtests/test_webclient.py (+2/-1)
ubuntuone/controlpanel/tests/__init__.py (+17/-0)
ubuntuone/controlpanel/tests/test_backend.py (+24/-35)
ubuntuone/controlpanel/tests/test_utils.py (+62/-2)
ubuntuone/controlpanel/tests/testcase.py (+0/-54)
ubuntuone/controlpanel/utils.py (+29/-0)
ubuntuone/controlpanel/webclient.py (+6/-5)
To merge this branch: bzr merge lp://qastaging/~nataliabidart/ubuntuone-control-panel/handle-sd-timeout
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+42549@code.qastaging.launchpad.net

Commit message

Handling properly any failure between dbus calls and errbacking deferreds (LP: #683760).

Description of the change

When passing DBus error signals to deferred's errback, we need to transform the twisted Failures into string-string dicts. Otherwise, we get traces like:

Unhandled error in Deferred:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 949, in gotResult
    _inlineCallbacks(r, g, deferred)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 939, in _inlineCallbacks
    deferred.errback()
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 345, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 424, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 441, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/usr/lib/pymodules/python2.6/dbus/decorators.py", line 309, in emit_signal
    message.append(signature=signature, *args)
exceptions.TypeError: iteration over non-sequence

To reproduce:

* Temporally make syncdaemon dbus service unavailable (edit /usr/share/dbus-1/services/com.ubuntuone.SyncDaemon.service and modify the Name= field so the dbus name doesn't exist)

* from trunk, run:

in terminal 1) PYTHONPATH=. ./bin/ubuntuone-control-panel-backend
in terminal 2) PYTHONPATH=. ./bin/ubuntuone-control-panel-gtk

* you'll see the trace I pasted above on terminal 1.

From this branch, reproduce the test case and this time you'll get, on terminal 1:

ERROR:ubuntuone.controlpanel.dbus_service:VolumesInfoError: args (<ubuntuone.controlpanel.dbus_service.ControlPanelBackend at /preferences at 0x343e550>, {'error_type': 'DBusException', 'error_msg': u'org.freedesktop.DBus.Error.ServiceUnknown: The name com.ubuntuone.SyncDaemon was not provided by any .service files'}), kwargs {}.

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) wrote :

As advertised.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches