summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-12-26 12:16:27 +0100
committerChristian Breunig <christian@breunig.cc>2025-12-26 12:17:11 +0100
commitf2ce2d66537e83b9859d70fea043f82089222104 (patch)
tree8e6630a48796c77eca0b7ff07987d910520f9677 /src
parentf4f19d33b5568fe14117b0c55fc4ccf423541730 (diff)
downloadvyos-1x-f2ce2d66537e83b9859d70fea043f82089222104.tar.gz
vyos-1x-f2ce2d66537e83b9859d70fea043f82089222104.zip
config: T8124: make get_config_dict() pki={} node purely optional
Automatic parsing and integration of the PKI subsystem into the resulting config dict is now enabled by passing with_pki=True to get_config_dict(). However, when no PKI configuration is present, the resulting dictionary still includes an empty PKI key. This is undesirable; we should only include keys in the dictionary when they contain relevant data.
Diffstat (limited to 'src')
-rw-r--r--src/conf_mode/load-balancing_haproxy.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/load-balancing_haproxy.py b/src/conf_mode/load-balancing_haproxy.py
index 4c26ed0b4..b5509f526 100644
--- a/src/conf_mode/load-balancing_haproxy.py
+++ b/src/conf_mode/load-balancing_haproxy.py
@@ -127,7 +127,7 @@ def verify(lb):
def generate(lb):
if not lb:
- # Delete /run/haproxy/haproxy.cfg
+ # Delete generated config files
config_files = [load_balancing_conf_file, systemd_override]
for file in config_files:
if os.path.isfile(file):
@@ -142,8 +142,8 @@ def generate(lb):
if not os.path.isdir(load_balancing_dir):
os.mkdir(load_balancing_dir)
- loaded_ca_certs = {load_certificate(c['certificate'])
- for c in lb['pki']['ca'].values()} if 'ca' in lb['pki'] else {}
+ loaded_ca_certs = {load_certificate(cert_data['certificate'])
+ for _, cert_data in dict_search('pki.ca', lb, default={}).items()}
# SSL Certificates for frontend
for front, front_config in lb['service'].items():