From 96f577ef82721b11b474d14d8155d30891a60d3f Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Wed, 5 Jan 2022 01:32:12 +0100 Subject: zone-policy: T4135: Raise error when using an invalid "from" zone. --- src/conf_mode/zone_policy.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/conf_mode/zone_policy.py b/src/conf_mode/zone_policy.py index d605e9639..683f8f034 100755 --- a/src/conf_mode/zone_policy.py +++ b/src/conf_mode/zone_policy.py @@ -95,6 +95,9 @@ def verify(zone_policy): if 'from' in zone_conf: for from_zone, from_conf in zone_conf['from'].items(): + if from_zone not in zone_policy['zone']: + raise ConfigError(f'Zone "{zone}" refers to a non-existent or deleted zone "{from_zone}"') + v4_name = dict_search_args(from_conf, 'firewall', 'name') if v4_name: if 'name' not in zone_policy['firewall']: -- cgit v1.2.3