diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-18 09:52:40 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-18 09:52:40 +0200 |
commit | 39ba9c31853838739659f4842d02a7e931107710 (patch) | |
tree | 89a5fad3f5c4b61ce420de50e6f288f207cae60c | |
parent | 6b2c3906c3ef1e8a72d6923fcea9cc340e59dd82 (diff) | |
download | vyos-1x-39ba9c31853838739659f4842d02a7e931107710.tar.gz vyos-1x-39ba9c31853838739659f4842d02a7e931107710.zip |
nptv6: T2518: remove superfluous else clause on missing outbound-interface
-rwxr-xr-x | src/conf_mode/nat66.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/conf_mode/nat66.py b/src/conf_mode/nat66.py index 8a3adc807..f8bc073bb 100755 --- a/src/conf_mode/nat66.py +++ b/src/conf_mode/nat66.py @@ -114,11 +114,10 @@ def verify(nat): for rule, config in dict_search('source.rule', nat).items(): err_msg = f'Source NAT66 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 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 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: |