1
0
mirror of https://github.com/gryf/wicd.git synced 2026-02-08 01:15:48 +01:00

check to see if the interface exists in the decorator

This commit is contained in:
Adam Blackburn
2009-07-05 08:16:59 -10:00
parent 6cedaf0199
commit fe18999be8

View File

@@ -171,7 +171,8 @@ def neediface(default_response):
"""
def wrapper(func):
def newfunc(self, *args, **kwargs):
if not self.iface:
if not self.iface or \
not os.path.exists('/sys/class/net/%s' % self.iface):
return default_response
return func(self, *args, **kwargs)
newfunc.__dict__ = func.__dict__