From d33cd2bb6073ea24265673c8368aea517390e70a Mon Sep 17 00:00:00 2001 From: minionatwork <60480922+minionatwork@users.noreply.github.com> Date: Tue, 17 Aug 2021 19:01:01 -0700 Subject: [PATCH] [multi-asic] Fix for sonic-cfggen exception during platform string read (#8229) Fix for sonic-cfggen exception during platform string read during fresh install and start of sonic in multi asic, /var/run/redisX/ is created after database docker is started. --- src/sonic-config-engine/sonic-cfggen | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index d895c0dde12c..98ef97f8a875 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -302,10 +302,6 @@ def main(): 'localhost': {'namespace_id': namespace_id} } }) - # Load the database config for the namespace from global database json - if args.namespace is not None: - SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) - if hwsku is not None: hardware_data = {'DEVICE_METADATA': {'localhost': { 'hwsku': hwsku @@ -354,6 +350,7 @@ def main(): if args.namespace is None: configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, **db_kwargs) else: + SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, namespace=args.namespace, **db_kwargs) configdb.connect() @@ -414,6 +411,7 @@ def main(): if args.namespace is None: configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs) else: + SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) configdb = ConfigDBPipeConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs) configdb.connect(False)