check to see if the interface exists in the decorator
This commit is contained in:
1 parent
6cedaf0199
commit
fe18999be8
1 file changed
+2
-1
+2
-1
@@ -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