summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-04-23 11:08:11 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-04-23 11:08:11 +0000
commitc67d28c6cc897d83ec802e56e6e4807a67e65d31 (patch)
treed303f93ab6f260e58dbe43363de1c404f2184e24 /python/vyos/configverify.py
parent7711018aaebbefeb19e6e551f24ce08531970f7f (diff)
downloadvyos-1x-c67d28c6cc897d83ec802e56e6e4807a67e65d31.tar.gz
vyos-1x-c67d28c6cc897d83ec802e56e6e4807a67e65d31.zip
verify: T4386: Fix traffic-policy key in verify_mirror
Fix logic for verify traffic-policy in def verify_mirror_redirect It checks just "traffic_policy.in" and should also checks if 'mirror' or 'redirect' exists in config
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r--python/vyos/configverify.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 1062d51ee..438485d98 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -1,4 +1,4 @@
-# Copyright 2020-2021 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2020-2022 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -205,10 +205,10 @@ def verify_mirror_redirect(config):
raise ConfigError(f'Requested redirect interface "{redirect_ifname}" '\
'does not exist!')
- if dict_search('traffic_policy.in', config) != None:
+ if ('mirror' in config or 'redirect' in config) and dict_search('traffic_policy.in', config) is not None:
# XXX: support combination of limiting and redirect/mirror - this is an
# artificial limitation
- raise ConfigError('Can not use ingress policy tigether with mirror or redirect!')
+ raise ConfigError('Can not use ingress policy together with mirror or redirect!')
def verify_authentication(config):
"""