@@ -21,10 +21,11 @@ static set<string> g_copp_init_set;
2121
2222void CoppMgr::parseInitFile (void )
2323{
24- std::ifstream ifs (COPP_INIT_FILE);
24+ std::ifstream ifs (m_coppCfgfile);
25+
2526 if (ifs.fail ())
2627 {
27- SWSS_LOG_ERROR (" COPP init file %s not found" , COPP_INIT_FILE );
28+ SWSS_LOG_ERROR (" COPP init file %s not found" , m_coppCfgfile. c_str () );
2829 return ;
2930 }
3031 json j = json::parse (ifs);
@@ -293,15 +294,16 @@ bool CoppMgr::isDupEntry(const std::string &key, std::vector<FieldValueTuple> &f
293294 return true ;
294295}
295296
296- CoppMgr::CoppMgr (DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames) :
297+ CoppMgr::CoppMgr (DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames, const string copp_init_file ) :
297298 Orch(cfgDb, tableNames),
298299 m_cfgCoppTrapTable(cfgDb, CFG_COPP_TRAP_TABLE_NAME),
299300 m_cfgCoppGroupTable(cfgDb, CFG_COPP_GROUP_TABLE_NAME),
300301 m_cfgFeatureTable(cfgDb, CFG_FEATURE_TABLE_NAME),
301302 m_appCoppTable(appDb, APP_COPP_TABLE_NAME),
302303 m_stateCoppTrapTable(stateDb, STATE_COPP_TRAP_TABLE_NAME),
303304 m_stateCoppGroupTable(stateDb, STATE_COPP_GROUP_TABLE_NAME),
304- m_coppTable(appDb, APP_COPP_TABLE_NAME)
305+ m_coppTable(appDb, APP_COPP_TABLE_NAME),
306+ m_coppCfgfile(copp_init_file)
305307{
306308 SWSS_LOG_ENTER ();
307309 parseInitFile ();
0 commit comments