From f4b114bd6e56a658c9560e6b0ccd3cc350cddb56 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Wed, 30 Nov 2016 18:11:32 +0100 Subject: [PATCH] [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 --- bumblebee/modules/nic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/nic.py b/bumblebee/modules/nic.py index 7532572..94f8bc4 100644 --- a/bumblebee/modules/nic.py +++ b/bumblebee/modules/nic.py @@ -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 = {}