summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-dummy.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 18:00:28 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commit0ea1abae11dfa5d376f4aff80cd87486370211ed (patch)
tree98775856a01de51abe24e78aa15248fd0543ab64 /src/conf_mode/interfaces-dummy.py
parentf81ca22c1988495943531cba11add7cfc9441033 (diff)
downloadvyos-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-xsrc/conf_mode/interfaces-dummy.py12
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