summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 19:41:42 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commitf11ce49a670507f814183e27c4f3e50e29e54e6e (patch)
treeef60d6350fd046b5de2657bc779074ffd7add11e /src/conf_mode
parent141d45d39d83fbd1eab025bcd00dabcadd6f4e61 (diff)
downloadvyos-1x-f11ce49a670507f814183e27c4f3e50e29e54e6e.tar.gz
vyos-1x-f11ce49a670507f814183e27c4f3e50e29e54e6e.zip
pseudo-ethernet: T2241: make VRF and bridge membership mutually exclusive
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-pseudo-ethernet.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py
index f9523ca8b..9f01cf0c1 100755
--- a/src/conf_mode/interfaces-pseudo-ethernet.py
+++ b/src/conf_mode/interfaces-pseudo-ethernet.py
@@ -122,9 +122,15 @@ def verify(peth):
if not peth['source_interface'] in interfaces():
raise ConfigError('Pseudo-ethernet source-interface does not exist')
- vrf_name = peth['vrf']
- if vrf_name and vrf_name not in interfaces():
- raise ConfigError(f'VRF "{vrf_name}" does not exist')
+ if peth['vrf']:
+ if peth['vrf'] not in interfaces():
+ raise ConfigError(f'VRF "{peth["vrf"]}" does not exist')
+
+ if peth['is_bridge_member']:
+ raise ConfigError((
+ f'Interface "{peth["intf"]}" cannot be member of VRF '
+ f'"{peth["vrf"]}" and bridge {peth["is_bridge_member"]} '
+ f'at the same time!'))
# use common function to verify VLAN configuration
verify_vlan_config(peth)