[modules/nic] Interfaces were always up

Wrong initialization of the status variable led to interfaces that were
always in up state.
This commit is contained in:
Tobias Witek 2016-11-06 10:59:25 +01:00
parent b6c430a8da
commit af6055bd83

View file

@ -17,9 +17,9 @@ class Module(bumblebee.module.Module):
def widgets(self):
result = []
interfaces = [ i for i in netifaces.interfaces() if not i.startswith(self._exclude) ]
state = "down"
for intf in interfaces:
addr = []
state = "down"
try:
if netifaces.AF_INET in netifaces.ifaddresses(intf):
for ip in netifaces.ifaddresses(intf)[netifaces.AF_INET]: