mirror of
https://github.com/gryf/wicd.git
synced 2026-03-02 06:35:49 +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 wrapper(func):
|
||||||
def newfunc(self, *args, **kwargs):
|
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 default_response
|
||||||
return func(self, *args, **kwargs)
|
return func(self, *args, **kwargs)
|
||||||
newfunc.__dict__ = func.__dict__
|
newfunc.__dict__ = func.__dict__
|
||||||
|
|||||||
Reference in New Issue
Block a user