[modules/nic] Add list of excluded interface prefixes as parameter

"nic.exclude" is now a parameter that can be used to have a custom list
of excluded interface prefixes. Multiple prefixes should be separated by
a comma.

fixes #26
This commit is contained in:
Tobi-wan Kenobi 2016-11-30 18:11:32 +01:00
parent c14189433d
commit f4b114bd6e

View file

@ -5,12 +5,14 @@ def description():
return "Displays the names, IP addresses and status of each available interface."
def parameters():
return [ "none" ]
return [
"nic.exclude: Comma-separated list of interface prefixes to exlude (defaults to: \"lo,virbr,docker,vboxnet,veth\")"
]
class Module(bumblebee.module.Module):
def __init__(self, output, config, alias):
super(Module, self).__init__(output, config, alias)
self._exclude = ( "lo", "virbr", "docker", "vboxnet", "veth" )
self._exclude = tuple(filter(len, self._config.parameter("exclude", "lo,virbr,docker,vboxnet,veth").split(",")))
self._state = "down"
self._typecache = {}