Skip to content

Commit

Permalink
[multi-asic] Fix for sonic-cfggen exception during platform string re…
Browse files Browse the repository at this point in the history
…ad (#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.
  • Loading branch information
minionatwork authored and qiluo-msft committed Sep 29, 2021
1 parent 76804da commit d33cd2b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sonic-config-engine/sonic-cfggen
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d33cd2b

Please sign in to comment.