summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-18 09:53:27 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-18 09:53:27 +0200
commit2606f95cb07f55716f4b205a0e88be259936703e (patch)
tree625b594268d6ede20fe9facbe7c508fa9b3af45a
parent39ba9c31853838739659f4842d02a7e931107710 (diff)
downloadvyos-1x-2606f95cb07f55716f4b205a0e88be259936703e.tar.gz
vyos-1x-2606f95cb07f55716f4b205a0e88be259936703e.zip
nat: T2198: remove superfluous else clause on missing outbound-interface
-rwxr-xr-xsrc/conf_mode/nat.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py
index dae958774..59939d0fb 100755
--- a/src/conf_mode/nat.py
+++ b/src/conf_mode/nat.py
@@ -139,12 +139,10 @@ def verify(nat):
for rule, config in dict_search('source.rule', nat).items():
err_msg = f'Source NAT configuration error in rule {rule}:'
if 'outbound_interface' not in config:
- raise ConfigError(f'{err_msg}\n' \
- 'outbound-interface not specified')
- else:
- if config['outbound_interface'] not in 'any' and config['outbound_interface'] not in interfaces():
- print(f'WARNING: rule "{rule}" interface "{config["outbound_interface"]}" does not exist on this system')
+ raise ConfigError(f'{err_msg} outbound-interface not specified')
+ if config['outbound_interface'] not in 'any' and config['outbound_interface'] not in interfaces():
+ print(f'WARNING: rule "{rule}" interface "{config["outbound_interface"]}" does not exist on this system')
addr = dict_search('translation.address', config)
if addr != None: