diff --git a/scripts/centralize_database b/scripts/centralize_database index c32b19b647..3b50184eac 100755 --- a/scripts/centralize_database +++ b/scripts/centralize_database @@ -6,19 +6,19 @@ import redis import argparse def centralize_to_target_db(target_dbname): - target_dbport = SonicDBConfig.get_port(target_dbname) - target_dbhost = SonicDBConfig.get_hostname(target_dbname) + target_dbport = SonicDBConfig.getDbPort(target_dbname) + target_dbhost = SonicDBConfig.getDbHostname(target_dbname) - dblists = SonicDBConfig.get_dblist() + dblists = SonicDBConfig.getDbList() for dbname in dblists: - dbport = SonicDBConfig.get_port(dbname) - dbhost = SonicDBConfig.get_hostname(dbname) + dbport = SonicDBConfig.getDbPort(dbname) + dbhost = SonicDBConfig.getDbHostname(dbname) # if the db is on the same instance, no need to move if dbport == target_dbport and dbhost == target_dbhost: continue - dbsocket = SonicDBConfig.get_socket(dbname) - dbid = SonicDBConfig.get_dbid(dbname) + dbsocket = SonicDBConfig.getDbSock(dbname) + dbid = SonicDBConfig.getDbId(dbname) r = redis.Redis(host=dbhost, unix_socket_path=dbsocket, db=dbid) @@ -49,7 +49,7 @@ Example : centralize_database APPL_DB if args.target_db: try: centralize_to_target_db(args.target_db) - print(SonicDBConfig.get_instancename(args.target_db)) + print(SonicDBConfig.getDbInst(args.target_db)) except Exception as ex: template = "An exception of type {0} occurred. Arguments:\n{1!r}" message = template.format(type(ex).__name__, ex.args)