@@ -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