Merge lp:~dobey/ubuntuone-client/nm-errors into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: Rick McBride
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntuone-client/nm-errors
Merge into: lp:ubuntuone-client
Diff against target: 45 lines (+12/-5)
2 files modified
ubuntuone/oauthdesktop/auth.py (+8/-1)
ubuntuone/syncdaemon/dbus_interface.py (+4/-4)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/nm-errors
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Tim Cole (community) Approve
Ubuntu One hackers Pending
Joshua Hoover Pending
Review via email: mp+14836@code.launchpad.net

This proposal supersedes a proposal from 2009-10-27.

Commit message

Try anyway if the error we get back from DBus is ServiceUnknown for NM

To post a comment you must log in.
Revision history for this message
Tim Cole (tcole) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Joshua Hoover (joshuahoover) wrote : Posted in a previous version of this proposal

I tested this with Rodney and we're closer. :) Tested this on Jaunty with the latest client release and using wicd instead of NetworkManager. I'm able to connect and add my computer. But then get this syncdaemon.log:

2009-10-27 16:05:10,083 - dbus.proxies - ERROR - Introspect error on org.freedesktop.NetworkManager:/org/freedesktop/NetworkManager: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files
2009-10-27 16:05:10,090 - ubuntuone.SyncDaemon.DBus - ERROR - Error while getting the NetworkManager state org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files

review: Needs Fixing
Revision history for this message
Tim Cole (tcole) :
review: Approve
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

looks good.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/oauthdesktop/auth.py'
2--- ubuntuone/oauthdesktop/auth.py 2009-10-26 18:24:25 +0000
3+++ ubuntuone/oauthdesktop/auth.py 2009-11-13 17:25:19 +0000
4@@ -306,7 +306,14 @@
5
6 def got_error(error):
7 """Handler for D-Bus errors when calling state()."""
8- logger.error("Unable to contact NetworkManager")
9+ if error.get_dbus_name() == \
10+ 'org.freedesktop.DBus.Error.ServiceUnknown':
11+ logger.debug("NetworkManager not available.")
12+ self.acquire_access_token(description, store)
13+ else:
14+ logger.error("Error contacting NetworkManager: %s" % \
15+ str(error))
16+
17
18 iface.state(reply_handler=got_state, error_handler=got_error)
19
20
21=== modified file 'ubuntuone/syncdaemon/dbus_interface.py'
22--- ubuntuone/syncdaemon/dbus_interface.py 2009-10-12 03:45:41 +0000
23+++ ubuntuone/syncdaemon/dbus_interface.py 2009-11-13 17:25:19 +0000
24@@ -999,6 +999,7 @@
25 'org.freedesktop.NetworkManager',
26 '/org/freedesktop/NetworkManager',
27 follow_name_owner_changes=True)
28+ iface = dbus.Interface(nm, 'org.freedesktop.NetworkManager')
29 except dbus.DBusException, e:
30 if e.get_dbus_name() == \
31 'org.freedesktop.DBus.Error.ServiceUnknown':
32@@ -1009,10 +1010,9 @@
33 else:
34 raise
35 else:
36- nm.Get('org.freedesktop.NetworkManager', 'State',
37- reply_handler=self.connection_state_changed,
38- error_handler=error_handler,
39- dbus_interface='org.freedesktop.DBus.Properties')
40+ iface.state(reply_handler=self.connection_state_changed,
41+ error_handler=error_handler)
42+
43 # register a handler to NM StateChanged signal
44 self.system_bus.add_signal_receiver(self.connection_state_changed,
45 signal_name='StateChanged',

Subscribers

People subscribed via source and target branches