summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-11-02 10:19:48 +0100
committerChristian Breunig <christian@breunig.cc>2025-11-02 10:22:15 +0100
commit01c10334b0b734bef51a5f26a93ef50a635b376a (patch)
treef07f3998e16d45826b0359d660f82731dd3a9092 /src
parent70e98aa2ce42eafaf3228ed6de2fc3e67095476f (diff)
downloadvyos-1x-01c10334b0b734bef51a5f26a93ef50a635b376a.tar.gz
vyos-1x-01c10334b0b734bef51a5f26a93ef50a635b376a.zip
pki: T7976: calls to node_changed_presence() must use unmangled config paths
We do use mangled config paths where pki = conf.get_config_dict(base, key_mangling=('-', '_'), ... returns a config dict where "-" is replaced by "_" when assembling the config dict keys. This does not work when we throw the retrieved path into ConfigDiff().node_changed_presence() https://github.com/vyos/vyos-1x/blob/07936657062c/src/conf_mode/pki.py#L259-L265 Add orig_path key which is preferred over path.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/pki.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conf_mode/pki.py b/src/conf_mode/pki.py
index f282eea68..6d2817384 100755
--- a/src/conf_mode/pki.py
+++ b/src/conf_mode/pki.py
@@ -83,6 +83,7 @@ sync_search = [
{
'keys': ['certificate', 'ca_certificate'],
'path': ['load_balancing', 'haproxy'],
+ 'orig_path': ['load-balancing', 'haproxy'],
},
{
'keys': ['key'],
@@ -276,11 +277,12 @@ def get_config(config=None):
if isinstance(found_name, str) and found_name != item_name:
continue
- path = search['path']
+ # prefer orig_path over path when unmangling is needed
+ path = search.get('orig_path', search.get('path'))
# Only enable this for debug purposes - otherwise we will always
# print this message for ACME certificates during renew tests -
# even if they are not due for renew!
- # path_str = ' '.join(path + found_path).replace('_','-')
+ # path_str = ' '.join(path + found_path)
# print(f'Updating configuration: "{path_str} {item_name}"')
if path[0] == 'interfaces':