diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 18:00:28 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 22:59:39 +0200 |
commit | 0ea1abae11dfa5d376f4aff80cd87486370211ed (patch) | |
tree | 98775856a01de51abe24e78aa15248fd0543ab64 /src/conf_mode/interfaces-dummy.py | |
parent | f81ca22c1988495943531cba11add7cfc9441033 (diff) | |
download | vyos-1x-0ea1abae11dfa5d376f4aff80cd87486370211ed.tar.gz vyos-1x-0ea1abae11dfa5d376f4aff80cd87486370211ed.zip |
dummy: T2241: make VRF and bridge membership mutually exclusive
Diffstat (limited to 'src/conf_mode/interfaces-dummy.py')
-rwxr-xr-x | src/conf_mode/interfaces-dummy.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-dummy.py b/src/conf_mode/interfaces-dummy.py index 7bc834be5..712f867e1 100755 --- a/src/conf_mode/interfaces-dummy.py +++ b/src/conf_mode/interfaces-dummy.py @@ -91,9 +91,15 @@ def verify(dummy): return None - vrf_name = dummy['vrf'] - if vrf_name and vrf_name not in interfaces(): - raise ConfigError(f'VRF "{vrf_name}" does not exist') + if dummy['vrf']: + if dummy['vrf'] not in interfaces(): + raise ConfigError(f'VRF "{dummy["vrf"]}" does not exist') + + if dummy['is_bridge_member']: + raise ConfigError(( + f'Interface "{dummy["intf"]}" cannot be member of VRF ' + f'"{dummy["vrf"]}" and bridge "{dummy["is_bridge_member"]}" ' + f'at the same time!')) return None |