1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-06 05:44:18 +01:00

Make sure we try each external app in order if selection is set to be automatic.

This commit is contained in:
Dan O'Reilly
2009-02-03 19:35:57 -05:00
parent b54dbcff92
commit 11c1c48b92
3 changed files with 12 additions and 15 deletions

View File

@@ -194,10 +194,10 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface):
except (IOError, ValueError, TypeError):
print 'Error checking link using /sys/class/net/%s/carrier' % self.iface
if self.miitool_cmd and self.link_detect == misc.MIITOOL:
return self._mii_get_plugged_in()
elif self.ethtool_cmd:
if self.ethtool_cmd and self.link_detect in [misc.ETHTOOL, misc.AUTO]:
return self._eth_get_plugged_in()
elif self.miitool_cmd and self.link_detect in [misc.MIITOOL, misc.AUTO]:
return self._mii_get_plugged_in()
else:
print 'Error: No way of checking for a wired connection. Make ' + \
'sure that either mii-tool or ethtool is installed.'

View File

@@ -191,9 +191,9 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface):
"""
if not self.iface: return False
if self.ethtool_cmd and self.link_detect != misc.MIITOOL:
if self.ethtool_cmd and self.link_detect in [misc.ETHTOOL, misc.AUTO]:
return self._eth_get_plugged_in()
elif self.miitool_cmd:
elif self.miitool_cmd and self.link_detect in [misc.MIITOOL, misc.AUTO]:
return self._mii_get_plugged_in()
else:
print 'Error: No way of checking for a wired connection. Make \