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:
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user