diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-03-03 18:25:56 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-03-03 18:29:13 +0100 |
commit | 47e6d60216ba6b3c86acb4097d04a454c9d0e723 (patch) | |
tree | 4b16312c5574be949a5c0c5b38f9c2a9e05206db /src/conf_mode/interfaces-wireless.py | |
parent | baa692d070fa80b514cf819cd5583d44247d955d (diff) | |
download | vyos-1x-47e6d60216ba6b3c86acb4097d04a454c9d0e723.tar.gz vyos-1x-47e6d60216ba6b3c86acb4097d04a454c9d0e723.zip |
interfaces: T1579: fix c/p error when evaluating os.environ['VYOS_TAGNODE_VALUE']
This has been only a theoretical problem but then the error condition was
triggered - only an error has been printed instead of raising an Exception.
Diffstat (limited to 'src/conf_mode/interfaces-wireless.py')
-rwxr-xr-x | src/conf_mode/interfaces-wireless.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py index 098aa8d97..5289208d9 100755 --- a/src/conf_mode/interfaces-wireless.py +++ b/src/conf_mode/interfaces-wireless.py @@ -894,10 +894,10 @@ def get_config(): conf = Config() # determine tagNode instance - try: - wifi['intf'] = os.environ['VYOS_TAGNODE_VALUE'] - except KeyError as E: - print("Interface not specified") + if 'VYOS_TAGNODE_VALUE' not in os.environ: + raise ConfigError('Interface (VYOS_TAGNODE_VALUE) not specified') + + wifi['intf'] = os.environ['VYOS_TAGNODE_VALUE'] # check if wireless interface has been removed cfg_base = 'interfaces wireless ' + wifi['intf'] |