Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <silbe@activitycentral.com>2011-03-10 11:45:17 (GMT)
committer Sascha Silbe <silbe@activitycentral.com>2011-10-18 15:41:58 (GMT)
commitce2745c8cd3b0b8aaadd0a9900fb74df16eb619a (patch)
tree9adeab05697687924fd93257dfe75c82401cc2c4
parent9bcbda746abdc03747bb57e9e955940fd1bf135a (diff)
Don't break if we may not own NetworkManagerUserSettings
The user might not have privileges to handle user settings - e.g. because they are logging in remotely (LTSP-style setups).
-rw-r--r--src/jarabe/desktop/meshbox.py2
-rw-r--r--src/jarabe/model/network.py13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index 6d5bb48..31f2b67 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -321,7 +321,7 @@ class NetworkManagerObserver(object):
dbus_interface=_NM_IFACE)
settings = network.get_settings()
- if settings is not None:
+ if not isinstance(settings, network.DummyNMSettings):
settings.secrets_request.connect(self.__secrets_request_cb)
def __secrets_request_cb(self, **kwargs):
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
index f265ae4..e55322b 100644
--- a/src/jarabe/model/network.py
+++ b/src/jarabe/model/network.py
@@ -535,6 +535,17 @@ class NMSettings(dbus.service.Object):
self.connections.pop(uuid)
+class DummyNMSettings(object):
+ """
+ Dummy object used when we don't own the NetworkManager user settings.
+ """
+
+ connections = {}
+
+ def clear_wifi_connections(self):
+ logging.debug('DummyNMSettings.clear_wifi_connections called')
+
+
class SecretsResponse(object):
"""Intermediate object to report the secrets from the dialog
back to the connection object and which will inform NM
@@ -815,6 +826,8 @@ def get_settings():
_nm_settings = NMSettings()
except dbus.DBusException:
logging.exception('Cannot create the UserSettings service.')
+ _nm_settings = DummyNMSettings()
+
load_connections()
return _nm_settings