Skip to content

Commit

Permalink
Revert "[sonic-cfggen]: Use unix socket when reading from DB only if …
Browse files Browse the repository at this point in the history
…we are using sudo. (#7002)"

This reverts commit a09a85b.
  • Loading branch information
yxieca authored Mar 11, 2021
1 parent 75e3f3a commit 34eccfc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/sonic-config-engine/sonic-cfggen
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,10 @@ def main():
deep_update(data, json.loads(args.additional_data))

if args.from_db:
use_unix_sock = True if os.getuid() == 0 else False
if args.namespace is None:
configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, **db_kwargs)
configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs)
else:
configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, namespace=args.namespace, **db_kwargs)
configdb = ConfigDBPipeConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs)

configdb.connect()
deep_update(data, FormatConverter.db_to_output(configdb.get_config()))
Expand Down

0 comments on commit 34eccfc

Please sign in to comment.