diff options
Diffstat (limited to 'src/jarabe/model/network.py')
-rw-r--r-- | src/jarabe/model/network.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py index 2607005..4dbc309 100644 --- a/src/jarabe/model/network.py +++ b/src/jarabe/model/network.py @@ -254,8 +254,8 @@ class NMSettingsConnection(dbus.service.Object): if not config.read(config_path): logging.error('Error reading the nm config file') return - except ConfigParser.ParsingError, e: - logging.error('Error reading the nm config file: %s' % e) + except ConfigParser.ParsingError: + logging.exception('Error reading the nm config file') return identifier = self._settings.connection.id @@ -292,13 +292,13 @@ class NMSettingsConnection(dbus.service.Object): elif self._settings.wireless_security.key_mgmt == 'wpa-psk': config.set(identifier, 'key', self._secrets.psk) except ConfigParser.Error, e: - logging.error('Error constructing %s: %s' % (identifier, e)) + logging.exception('Error constructing %s', identifier) else: f = open(config_path, 'w') try: config.write(f) - except ConfigParser.Error, e: - logging.error('Can not write %s error: %s' % (config_path, e)) + except ConfigParser.Error: + logging.exception('Can not write %s', config_path) f.close() @dbus.service.method(dbus_interface=NM_CONNECTION_IFACE, @@ -310,16 +310,16 @@ class NMSettingsConnection(dbus.service.Object): async_callbacks=('reply', 'error'), in_signature='sasb', out_signature='a{sa{sv}}') def GetSecrets(self, setting_name, hints, request_new, reply, error): - logging.debug('Secrets requested for connection %s request_new=%s' - % (self.path, request_new)) + logging.debug('Secrets requested for connection %s request_new=%s', + self.path, request_new) if request_new or self._secrets is None: # request_new is for example the case when the pw on the AP changes response = SecretsResponse(self, reply, error) try: self.secrets_request.send(self, response=response) - except Exception, e: - logging.error('Error requesting the secrets via dialog: %s' % e) + except Exception: + logging.exception('Error requesting the secrets via dialog') else: reply(self._secrets.get_dict()) @@ -328,8 +328,8 @@ def get_settings(): if _nm_settings is None: try: _nm_settings = NMSettings() - except dbus.DBusException, e: - logging.error('Cannot create the UserSettings service %s.', e) + except dbus.DBusException: + logging.exception('Cannot create the UserSettings service.') load_connections() return _nm_settings @@ -367,8 +367,8 @@ def load_connections(): if not config.read(config_path): logging.error('Error reading the nm config file') return - except ConfigParser.ParsingError, e: - logging.error('Error reading the nm config file: %s' % e) + except ConfigParser.ParsingError: + logging.exception('Error reading the nm config file') return for section in config.sections(): @@ -412,7 +412,7 @@ def load_connections(): if config.has_option(section, 'pairwise'): value = config.get(section, 'pairwise') settings.wireless_security.pairwise = value - except ConfigParser.Error, e: - logging.error('Error reading section: %s' % e) + except ConfigParser.Error: + logging.exception('Error reading section') else: add_connection(ssid, settings, secrets) |