From 6a1e4693ef11bb7d11611822161612499ace6e23 Mon Sep 17 00:00:00 2001 From: Matheus Guilhermino Date: Mon, 4 Aug 2025 23:52:16 -0300 Subject: [PATCH] Fix ConfigParser interpolation error on software.conf When parsing software.config, ConfigParser performs interpolation on any '%(option)s' patterns it encounters. The logging_default_format_string contained standard Python logging format specifiers (%(asctime)s, %(msecs)03d, %(levelname)s), which ConfigParser incorrectly attempted to treat as config variable substitutions. This resulted in errors during deploy-precheck, preventing us from continuing with a software deploy. To resolve this without modifying USM's config loading logic, _deploy_precheck() was updated to instantiate ConfigParser with 'interpolation=None' to disable interpolation and preserve the raw format strings. This allows the precheck to read keystone_authtoken credentials without error while maintaining correct logging format processing by the logging module. Closes-bug: 2119488 Test Plan: PASS: AIO-SX - software deploy precheck passes PASS: AIO-SX - software deploy successful PASS: Logging output remains correctly formatted. Change-Id: I004bb3d7a8e9149509cd77826ed23ee187009162 Signed-off-by: Matheus Guilhermino --- software/software/software_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/software/software_controller.py b/software/software/software_controller.py index 47c899f2..2b3fd0d7 100644 --- a/software/software/software_controller.py +++ b/software/software/software_controller.py @@ -2813,7 +2813,7 @@ class PatchController(PatchService): # parse local config file to pass parameters to precheck script try: - cp = configparser.ConfigParser() + cp = configparser.ConfigParser(interpolation=None) cp.read(constants.SOFTWARE_CONFIG_FILE_LOCAL) ks_section = dict(cp["keystone_authtoken"]) if cp.has_section("keystone_authtoken") else {} auth_url = ks_section.get("auth_url")