summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-05 20:54:30 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-05 20:54:30 +0200
commit5accf7227858cde303e0c49f8c36408ef4c5fb93 (patch)
tree1d972cf9c96748f7db7afe0f513d0394789041b1
parent2a0428bf11cbe5a2377f9190ac6e9286a1575aac (diff)
downloadvyos-1x-5accf7227858cde303e0c49f8c36408ef4c5fb93.tar.gz
vyos-1x-5accf7227858cde303e0c49f8c36408ef4c5fb93.zip
wireless: T2963: remove default wpa mode key if passphares or RADIUS is unset
Required to not trigger the "Misssing WPA key or RADIUS server" exception due to the new default value added in commit 2a0428bf ("wireless: T2963: set default 'both' on 'security wpa mode'").
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index ad8aee168..c1770771e 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -76,6 +76,14 @@ def get_config(config=None):
base = ['interfaces', 'wireless']
wifi = get_interface_dict(conf, base)
+
+ # Cleanup "delete" default values when required user selectable values are
+ # not defined at all
+ tmp = conf.get_config_dict([], key_mangling=('-', '_'), get_first_key=True)
+ if not (vyos_dict_search('security.wpa.passphrase', tmp) or
+ vyos_dict_search('security.wpa.radius', tmp)):
+ 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 vyos_dict_search('security.wpa.radius.server.port', wifi):