1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-06 13:54:17 +01:00

Merged r306 of mainline 1.6

This commit is contained in:
Andrew Psaltis
2009-02-21 01:17:22 -05:00

View File

@@ -335,14 +335,16 @@ class WirelessInterface(Interface, wnettools.BaseWirelessInterface):
def _connect_to_wpa_ctrl_iface(self): def _connect_to_wpa_ctrl_iface(self):
""" Connect to the wpa ctrl interface. """ """ Connect to the wpa ctrl interface. """
ctrl_iface = '/var/run/wpa_supplicant' ctrl_iface = '/var/run/wpa_supplicant'
socket_loc = os.path.join(ctrl_iface, self.iface)
if os.path.exists(socket_loc):
try: try:
socket = [os.path.join(ctrl_iface, s) \
for s in os.listdir(ctrl_iface) if s == self.iface][0]
except OSError, error:
print error
return None
return wpactrl.WPACtrl(socket) return wpactrl.WPACtrl(socket)
except wpactrl.error, e:
print "Couldn't open ctrl_interface: %s" % e
return None
else:
print "Couldn't find a wpa_supplicant ctrl_interface for iface %s" % self.iface
return None
def ValidateAuthentication(self, auth_time): def ValidateAuthentication(self, auth_time):
""" Validate WPA authentication. """ Validate WPA authentication.