[modules/nic] Fix status display
First, cache lookups were bugged... Second, the output needs to call data() first, everything else later. This is a bit nasty, and I'll consider re-visiting this, but right now, I don't see any other way, given that modules can now be iterated.
This commit is contained in:
parent
0f6b418385
commit
f29ddae47a
2 changed files with 5 additions and 3 deletions
|
@ -44,12 +44,13 @@ class Module(bumblebee.module.Module):
|
|||
try:
|
||||
iw.get_interface_by_ifindex(idx)
|
||||
self._cache["wlan{}".format(intf)] = True
|
||||
except exception as e:
|
||||
except Exception as e:
|
||||
self._cache["wlan{}".format(intf)] = False
|
||||
return self._cache
|
||||
return self._cache["wlan{}".format(intf)]
|
||||
|
||||
def state(self):
|
||||
t = "wireless" if self._iswlan(self._intf) else "wired"
|
||||
|
||||
return "{}-{}".format(t, self._state)
|
||||
|
||||
def warning(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue