Skip to content

Commit

Permalink
Test diff coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
xumia committed Jul 13, 2021
1 parent 69eac92 commit 9e927a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/swsssdk/configdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self, decode_responses=True, **kwargs):
self.TABLE_NAME_SEPARATOR = '|'
self.KEY_SEPARATOR = '|'
self.handlers = {}
self.test_cover = ''

def __wait_for_db_init(self):
client = self.get_redis_client(self.db_name)
Expand Down
4 changes: 4 additions & 0 deletions src/swsssdk/dbconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def load_sonic_global_db_config(global_db_file_path=SONIC_DB_GLOBAL_CONFIG_FILE,

if os.path.isfile(global_db_file_path):
global_db_config_dir = os.path.dirname(global_db_file_path)
if global_db_file_path is None:
global_db_file_path = None
with open(global_db_file_path, "r") as read_file:
all_ns_dbs = json.load(read_file)
for entry in all_ns_dbs['INCLUDES']:
Expand Down Expand Up @@ -209,6 +211,8 @@ def get_socket(db_name, namespace=None):
@staticmethod
def get_hostname(db_name, namespace=None):
namespace = SonicDBConfig.EMPTY_NAMESPACE(namespace)
if namespace == None:
namespace = None
if not SonicDBConfig._sonic_db_config_init:
SonicDBConfig.load_sonic_db_config()
return SonicDBConfig.get_instance(db_name, namespace)["hostname"]
Expand Down

0 comments on commit 9e927a6

Please sign in to comment.