Skip to content

Commit 4ac595a

Browse files
Fix the isChassisAppDbPresent check
The correct path to check for is /var/run/redis/sonic-db/database_config.json and not /etc/sonic/database_config.json Updated the UT's conftest.py as well Signed-off-by: Saravanan <[email protected]>
1 parent 90406d9 commit 4ac595a

3 files changed

Lines changed: 1 addition & 103 deletions

File tree

orchagent/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void getCfgSwitchType(DBConnector *cfgDb, string &switch_type, string &switch_su
218218

219219
bool isChassisAppDbPresent()
220220
{
221-
std::ifstream file("/etc/sonic/database_config.json");
221+
std::ifstream file(SonicDBConfig::DEFAULT_SONIC_DB_CONFIG_FILE);
222222
if (!file.is_open()) return false;
223223

224224
nlohmann::json db_config;

tests/conftest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,6 @@ def create_vct_ctn(self, ctndir):
17041704
vol = {}
17051705
vol[chassis_config_dir] = {"bind": "/usr/share/sonic/virtual_chassis", "mode": "ro"}
17061706

1707-
# Mount database_config.json when connect_to_chassis_db is set to 1
1708-
if defcfg.get("connect_to_chassis_db") == 1:
1709-
database_config_file = cwd + "/virtual_chassis/database_config.json"
1710-
vol[database_config_file] = {"bind": "/etc/sonic/database_config.json", "mode": "ro"}
1711-
17121707
# pass self.ns into the vs to be use for vs restarts by swss conftest.
17131708
# connection to chassbr is setup by chassis_connect.py within the vs
17141709
data = {}

tests/virtual_chassis/database_config.json

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)