Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <silbe@activitycentral.com>2012-04-02 13:07:19 (GMT)
committer Sascha Silbe <silbe@activitycentral.com>2012-04-10 18:21:41 (GMT)
commitb0cd1c99318f5fd95d254b263cd53b3f852c527a (patch)
tree16620fd32a75a147c5bb75049611a86f2fa8df86
parent48fd21f8c8df85aaafdd9a97064836862d7fc9c6 (diff)
Fix Traceback when connecting to a network for the first time
When connecting to a network that we don't have settings for yet, the following Traceback was logged: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 586, in msg_reply_handler reply_handler(*message.get_args_list(**get_args_opts)) TypeError: _activate_reply_cb() takes exactly 1 argument (2 given) This is because the same set of callbacks was used for both ActivateConnection() and AddAndActivateConnection() even though they return different sets of values. Signed-off-by: Sascha Silbe <silbe@activitycentral.com> Reviewed-by: Daniel Drake <dsd@laptop.org>
-rw-r--r--src/jarabe/model/network.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
index af510e1..40eb6d0 100644
--- a/src/jarabe/model/network.py
+++ b/src/jarabe/model/network.py
@@ -728,14 +728,22 @@ def get_secret_agent():
return _secret_agent
-def _activate_reply_cb(connection):
- logging.debug('Activated connection: %s', connection)
+def _activate_reply_cb(connection_path):
+ logging.debug('Activated connection: %s', connection_path)
def _activate_error_cb(err):
logging.error('Failed to activate connection: %s', err)
+def _add_and_activate_reply_cb(settings_path, connection_path):
+ logging.debug('Added and activated connection: %s', connection_path)
+
+
+def _add_and_activate_error_cb(err):
+ logging.error('Failed to add and activate connection: %s', err)
+
+
class Connection(gobject.GObject):
__gsignals__ = {
'removed': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
@@ -900,10 +908,11 @@ def activate_connection_by_path(connection, device_o,
def add_and_activate_connection(device_o, settings, specific_object):
- get_manager().AddAndActivateConnection(settings.get_dict(), device_o,
- specific_object,
- reply_handler=_activate_reply_cb,
- error_handler=_activate_error_cb)
+ manager = get_manager()
+ manager.AddAndActivateConnection(settings.get_dict(), device_o,
+ specific_object,
+ reply_handler=_add_and_activate_reply_cb,
+ error_handler=_add_and_activate_error_cb)
def _migrate_old_wifi_connections():