Merge lp://staging/~tealeg/landscape-client/catch-unreachable-server into lp://staging/~landscape/landscape-client/trunk
Proposed by
Geoff Teale
Status: | Merged |
---|---|
Approved by: | Thomas Herve |
Approved revision: | 492 |
Merged at revision: | 491 |
Proposed branch: | lp://staging/~tealeg/landscape-client/catch-unreachable-server |
Merge into: | lp://staging/~landscape/landscape-client/trunk |
Diff against target: |
191 lines (+90/-16) 5 files modified
landscape/ui/controller/app.py (+14/-11) landscape/ui/controller/configuration.py (+3/-1) landscape/ui/controller/tests/test_app.py (+2/-1) landscape/ui/model/registration/proxy.py (+13/-3) landscape/ui/model/registration/tests/test_proxy.py (+58/-0) |
To merge this branch: | bzr merge lp://staging/~tealeg/landscape-client/catch-unreachable-server |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thomas Herve (community) | Approve | ||
Free Ekanayaka (community) | Approve | ||
Review via email: mp+96767@code.staging.launchpad.net |
Description of the change
Fixes bug #949208.
This branch catches the offending timeout exception and changed the register call to always be synchronous as the asynchronous call backs are lost under failure conditions.
There is also a small fix to the use of Notify that was previously masked by the lost callback problem.
To post a comment you must log in.
[1]
if self._bus:
- return self._interface
- reply_handler=
- error_handler=
+ try:
+ result, message = self._interface
+ except dbus.DBusException, e:
+ if e.get_dbus_name() != "org.freedeskto
+ raise
+ else:
+ error_handler(
+ if result:
The "result" variable will be undefined if error_handler() is called, and indeed TimeoutTest. test_register fails:
landscape. ui.model. registration. tests.test_ proxy
TimeoutTest
test_register ... [ERROR]
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == free/src/ client/ trunk/landscape /tests/ mocker. py", line 146, in test_method_wrapper free/src/ client/ trunk/landscape /ui/model/ registration/ tests/test_ proxy.py" , line 64, in test_register proxy.register( "foo", error_handler= fake_error_ handler) free/src/ client/ trunk/landscape /ui/model/ registration/ proxy.py" , line 116, in register UnboundLocalErr or: local variable 'result' referenced before assignment
[ERROR]
Traceback (most recent call last):
File "/home/
result = test_method()
File "/home/
self.
File "/home/
if result:
exceptions.
landscape. ui.model. registration. tests.test_ proxy.TimeoutTe st.test_ register ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --
-------
Ran 1 tests in 0.003s