summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-02 20:37:11 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-02-03 05:03:07 +0000
commitc224be5a55f60d972eb22dab786da0da6f874bb0 (patch)
tree8ad3daeca1f5b692ddd3448812f65160b25f4daa /python
parent2d8a7bda382fbd95b4bee7c6e966dfc072b52bfd (diff)
downloadvyos-1x-c224be5a55f60d972eb22dab786da0da6f874bb0.tar.gz
vyos-1x-c224be5a55f60d972eb22dab786da0da6f874bb0.zip
configdict: T5894: preserve old behavior when dealing with PKI
Commit b152b5202 ("configdict: T5894: add get_config_dict() flag with_pki") added the generic PKI flag but if there was no PKI subsystem available in the configuration, no pki dict key ever manifested in the resulting dictionary requested by the caller. This is different to the old behavior (which each caller implementing the call itself) where there always was a pki key present - even if it was empty. This triggered a bug in the IPSec script Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/vpn_ipsec.py", line 600, in <module> verify(ipsec) File "/usr/libexec/vyos/conf_mode/vpn_ipsec.py", line 372, in verify verify_pki_rsa(ipsec['pki'], rsa) ~~~~~^^^^^^^ KeyError: 'pki' As it wanted to verify keys, but there was no pki dictionary key available. This commit restores the previous behavior. (cherry picked from commit 9b56a86def674886721a367c02371f9da65c3fd3)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/config.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py
index bee85315d..7619ad367 100644
--- a/python/vyos/config.py
+++ b/python/vyos/config.py
@@ -343,7 +343,7 @@ class Config(object):
pki_dict['certificate'][certificate] = config_dict_mangle_acme(
certificate, pki_dict['certificate'][certificate])
- conf_dict['pki'] = pki_dict
+ conf_dict['pki'] = pki_dict
# save optional args for a call to get_config_defaults
setattr(conf_dict, '_dict_kwargs', kwargs)