Skip to content

Commit 951aa12

Browse files
osfricklerberendt
authored andcommitted
sonic: fix VERSIONS config
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
1 parent 42cde75 commit 951aa12

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

files/sonic/config_db.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
"TELEMETRY": {
443443
"gnmi": {}
444444
},
445-
"VERSION": {
445+
"VERSIONS": {
446446
"DATABASE": {
447447
"VERSION": "version_4_0_1"
448448
}

osism/tasks/conductor/sonic/config_generator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ def generate_sonic_config(device, hwsku, device_as_mapping=None, config_version=
269269
_add_vrf_configuration(config, vrf_info, netbox_interfaces)
270270

271271
# Set DATABASE VERSION from config_version parameter or default
272-
if "VERSION" not in config:
273-
config["VERSION"] = {}
274-
if "DATABASE" not in config["VERSION"]:
275-
config["VERSION"]["DATABASE"] = {}
272+
if "VERSIONS" not in config:
273+
config["VERSIONS"] = {}
274+
if "DATABASE" not in config["VERSIONS"]:
275+
config["VERSIONS"]["DATABASE"] = {}
276276

277277
if config_version:
278278
# Normalize config_version: add "version_" prefix if not present
@@ -283,12 +283,12 @@ def generate_sonic_config(device, hwsku, device_as_mapping=None, config_version=
283283
f"Normalized config_version from '{config_version}' to '{normalized_version}' for device {device.name}"
284284
)
285285

286-
config["VERSION"]["DATABASE"]["VERSION"] = normalized_version
286+
config["VERSIONS"]["DATABASE"]["VERSION"] = normalized_version
287287
logger.info(
288288
f"Using custom config_version '{normalized_version}' for device {device.name}"
289289
)
290-
elif "VERSION" not in config.get("VERSION", {}).get("DATABASE", {}):
291-
config["VERSION"]["DATABASE"]["VERSION"] = "version_4_0_1"
290+
elif "VERSION" not in config.get("VERSIONS", {}).get("DATABASE", {}):
291+
config["VERSIONS"]["DATABASE"]["VERSION"] = "version_4_0_1"
292292
logger.debug(
293293
f"Using default config_version 'version_4_0_1' for device {device.name}"
294294
)

0 commit comments

Comments
 (0)