Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cfggen] Use Redis Pipeline #5250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/sonic-config-engine/sonic-cfggen
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ from sonic_py_common.device_info import get_platform, get_system_mac
from sonic_py_common.multi_asic import get_asic_id_from_name, is_multi_asic
from config_samples import generate_sample_config
from config_samples import get_available_config
from swsssdk import SonicV2Connector, ConfigDBConnector, SonicDBConfig
from swsssdk import SonicV2Connector, ConfigDBConnector, SonicDBConfig, ConfigDBPipeConnector
from redis_bcc import RedisBytecodeCache
from collections import OrderedDict
from natsort import natsorted
Expand Down Expand Up @@ -340,9 +340,9 @@ def main():

if args.from_db:
if args.namespace is None:
configdb = ConfigDBConnector(use_unix_socket_path=True, **db_kwargs)
configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs)
else:
configdb = ConfigDBConnector(use_unix_socket_path=True, 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 Expand Up @@ -401,9 +401,9 @@ def main():

if args.write_to_db:
if args.namespace is None:
configdb = ConfigDBConnector(use_unix_socket_path=True, **db_kwargs)
configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs)
else:
configdb = ConfigDBConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs)
configdb = ConfigDBPipeConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs)

configdb.connect(False)
configdb.mod_config(FormatConverter.output_to_db(data))
Expand Down