summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-10-11 16:47:08 +0200
committerChristian Poessinger <christian@poessinger.com>2021-10-11 16:47:08 +0200
commit46e331cdf44b7880f6e2f5fefaa1f536829f6ebc (patch)
tree798de7082bfd656761305c3aa279e0cba29952e2 /src
parent4218a5bcb1093108e25d4e07fa07050b4f79d3d5 (diff)
downloadvyos-1x-46e331cdf44b7880f6e2f5fefaa1f536829f6ebc.tar.gz
vyos-1x-46e331cdf44b7880f6e2f5fefaa1f536829f6ebc.zip
vyos.configdict: T2653: do not merge in defaults when interface is deleted
It makes less to zero sense to blend in the default values of an interface when it is about to be deleted from the system anyways - this makes the entire dict just cleaner and easier to debug.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index 7b3de6e8a..af35b5f03 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -82,11 +82,12 @@ def get_config(config=None):
tmp = conf.get_config_dict([], key_mangling=('-', '_'), get_first_key=True)
if not (dict_search('security.wpa.passphrase', tmp) or
dict_search('security.wpa.radius', tmp)):
- del wifi['security']['wpa']
+ if 'deleted' not in wifi:
+ del wifi['security']['wpa']
# defaults include RADIUS server specifics per TAG node which need to be
# added to individual RADIUS servers instead - so we can simply delete them
- if dict_search('security.wpa.radius.server.port', wifi):
+ if dict_search('security.wpa.radius.server.port', wifi) != None:
del wifi['security']['wpa']['radius']['server']['port']
if not len(wifi['security']['wpa']['radius']['server']):
del wifi['security']['wpa']['radius']