From 29c12dc0d2b02005a8c4931a155e079b106d345d Mon Sep 17 00:00:00 2001 From: Tom Van Braeckel Date: Thu, 12 Feb 2015 18:01:42 +0100 Subject: [PATCH] Wireless network interface should only be auto-detected when nothing is specified in /etc/wicd/manager-settings.conf If the user makes this empty, it will not be autodetected anymore. --- wicd/configmanager.py | 5 ++--- wicd/wicd-daemon.py | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index ae63a31..d026170 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -113,8 +113,7 @@ class ConfigManager(RawConfigParser): else: return None - # If the option is present and not empty - if self.has_option(section, option) and RawConfigParser.get(self, section, option) != "None": + if self.has_option(section, option): ret = RawConfigParser.get(self, section, option) if (isinstance(ret, basestring) and ret.startswith(self.mrk_ws) and ret.endswith(self.mrk_ws)): @@ -131,7 +130,7 @@ class ConfigManager(RawConfigParser): else: print ''.join(['found ', option, ' in configuration ', str(ret)]) - else: + else: # Use the default, unless no default was provided if default != "__None__": print 'did not find %s in configuration, setting default %s' \ % (option, str(default)) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index cd49dc6..614ac84 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -162,6 +162,7 @@ class WicdDaemon(dbus.service.Object, object): def SetWiredInterface(self, interface): """ Sets the wired interface for the daemon to use. """ print "setting wired interface %s" % (str(interface)) + # Set it to a blank string, otherwise a network card named "None" will be searched self.wired.wired_interface = noneToBlankString(interface) self.config.set("Settings", "wired_interface", interface, write=True) @@ -169,6 +170,7 @@ class WicdDaemon(dbus.service.Object, object): def SetWirelessInterface(self, interface): """ Sets the wireless interface the daemon will use. """ print "setting wireless interface %s" % (str(interface)) + # Set it to a blank string, otherwise a network card named "None" will be searched self.wifi.wireless_interface = noneToBlankString(interface) self.config.set("Settings", "wireless_interface", interface, write=True)