summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-06 21:23:44 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-06 21:23:44 +0200
commit3cd59879451504b4da865cc066112b1da882e5af (patch)
treee8242cd0c7f99a5fb5c113c944cdbb65649cfa3e /src
parentb45cef9185cc78de7bc4170403e47b8ee1d14e3b (diff)
downloadvyos-1x-3cd59879451504b4da865cc066112b1da882e5af.tar.gz
vyos-1x-3cd59879451504b4da865cc066112b1da882e5af.zip
pki: eapol: T3642: only add "pki" key to interface dict if pki is configured
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-ethernet.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py
index 31998a9a8..21a04f954 100755
--- a/src/conf_mode/interfaces-ethernet.py
+++ b/src/conf_mode/interfaces-ethernet.py
@@ -55,15 +55,17 @@ def get_config(config=None):
conf = config
else:
conf = Config()
- base = ['interfaces', 'ethernet']
- tmp_pki = conf.get_config_dict(['pki'], key_mangling=('-', '_'),
- get_first_key=True, no_tag_node_value_mangle=True)
+ # This must be called prior to get_interface_dict(), as this function will
+ # alter the config level (config.set_level())
+ pki = conf.get_config_dict(['pki'], key_mangling=('-', '_'),
+ get_first_key=True, no_tag_node_value_mangle=True)
+ base = ['interfaces', 'ethernet']
ethernet = get_interface_dict(conf, base)
if 'deleted' not in ethernet:
- ethernet['pki'] = tmp_pki
+ if pki: ethernet['pki'] = pki
return ethernet