Skip to content

Commit

Permalink
[PORTSYNCD] when no ports on config db on init, continue and set Port…
Browse files Browse the repository at this point in the history
…ConfigDone (#1861)

*continue the execution of handlePortConfigFromConfigDB when no ports on config db -> continue and set PortConfigDone
*function handlePortConfigFromConfigDB is no longer boolean - change it to void

Signed-off-by: tomeri <[email protected]>
  • Loading branch information
tomer-israel authored Sep 29, 2021
1 parent a031542 commit 3249cdb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void usage()
}

void handlePortConfigFile(ProducerStateTable &p, string file, bool warm);
bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm);
void handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm);
void handleVlanIntfFile(string file);
void handlePortConfig(ProducerStateTable &p, map<string, KeyOpFieldsValuesTuple> &port_cfg_map);
void checkPortInitDone(DBConnector *appl_db);
Expand Down Expand Up @@ -86,11 +86,7 @@ int main(int argc, char **argv)
netlink.dumpRequest(RTM_GETLINK);
cout << "Listen to link messages..." << endl;

if (!handlePortConfigFromConfigDB(p, cfgDb, warm))
{
SWSS_LOG_NOTICE("ConfigDB does not have port information, "
"however ports can be added later on, continuing...");
}
handlePortConfigFromConfigDB(p, cfgDb, warm);

LinkSync sync(&appl_db, &state_db);
NetDispatcher::getInstance().registerMessageHandler(RTM_NEWLINK, &sync);
Expand Down Expand Up @@ -191,7 +187,7 @@ static void notifyPortConfigDone(ProducerStateTable &p)
p.set("PortConfigDone", attrs);
}

bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm)
void handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm)
{
SWSS_LOG_ENTER();

Expand All @@ -204,8 +200,8 @@ bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, boo

if (keys.empty())
{
cout << "No port configuration in ConfigDB" << endl;
return false;
SWSS_LOG_NOTICE("ConfigDB does not have port information, "
"however ports can be added later on, continuing...");
}

for ( auto &k : keys )
Expand All @@ -228,7 +224,6 @@ bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, boo
notifyPortConfigDone(p);
}

return true;
}

void handlePortConfig(ProducerStateTable &p, map<string, KeyOpFieldsValuesTuple> &port_cfg_map)
Expand Down

0 comments on commit 3249cdb

Please sign in to comment.