[modules/nic] fix missing check for None
This commit is contained in:
parent
8897c1bde5
commit
03731136b6
1 changed files with 4 additions and 3 deletions
|
@ -75,10 +75,11 @@ class Module(core.module.Module):
|
||||||
iftype = "tunnel" if self._istunnel(intf) else iftype
|
iftype = "tunnel" if self._istunnel(intf) else iftype
|
||||||
|
|
||||||
# "strength" is none if interface type is not wlan
|
# "strength" is none if interface type is not wlan
|
||||||
if self._iswlan(intf):
|
strength = widget.get("strength")
|
||||||
if widget.get("strength") < self._strength_threshold_critical:
|
if self._iswlan(intf) and strength:
|
||||||
|
if strength < self._strength_threshold_critical:
|
||||||
states.append("critical")
|
states.append("critical")
|
||||||
elif widget.get("strength") < self._strength_threshold_warning:
|
elif strength < self._strength_threshold_warning:
|
||||||
states.append("warning")
|
states.append("warning")
|
||||||
|
|
||||||
states.append("{}-{}".format(iftype, widget.get("state")))
|
states.append("{}-{}".format(iftype, widget.get("state")))
|
||||||
|
|
Loading…
Reference in a new issue