diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-03 13:46:47 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 20:58:06 +0200 |
commit | 900e75e387939a1d1d4d5b0b79809b8bb2305b91 (patch) | |
tree | 6575a6da1691f712e88bf6c49bca6b0569a7f672 /src/conf_mode/interfaces-dummy.py | |
parent | c1ad2a6461fc2e767d69567be9647150c3310569 (diff) | |
download | vyos-1x-900e75e387939a1d1d4d5b0b79809b8bb2305b91.tar.gz vyos-1x-900e75e387939a1d1d4d5b0b79809b8bb2305b91.zip |
validate: T2241: rewrite is_bridge_member to generic is_member
- rewrite the function to support both bridge and bonding interface types,
if the type is passed it searches only that type, otherwise it searches
both
- move is_member check out of the deleted condition
- move is_member check to intf_from_dict for interfaces that use it
Diffstat (limited to 'src/conf_mode/interfaces-dummy.py')
-rwxr-xr-x | src/conf_mode/interfaces-dummy.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-dummy.py b/src/conf_mode/interfaces-dummy.py index 23eaa4ecb..7bc834be5 100755 --- a/src/conf_mode/interfaces-dummy.py +++ b/src/conf_mode/interfaces-dummy.py @@ -23,7 +23,7 @@ from netifaces import interfaces from vyos.ifconfig import DummyIf from vyos.configdict import list_diff from vyos.config import Config -from vyos.validate import is_bridge_member +from vyos.validate import is_member from vyos import ConfigError default_config_data = { @@ -47,11 +47,12 @@ def get_config(): dummy['intf'] = os.environ['VYOS_TAGNODE_VALUE'] + # check if we are a member of any bridge + dummy['is_bridge_member'] = is_member(conf, dummy['intf'], 'bridge') + # Check if interface has been removed if not conf.exists('interfaces dummy ' + dummy['intf']): dummy['deleted'] = True - # check if interface is member if a bridge - dummy['is_bridge_member'] = is_bridge_member(conf, dummy['intf']) return dummy # set new configuration level |