Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
liuh-80 committed Sep 27, 2024
1 parent 8b6ef4a commit b460a3a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cfgmgr/portmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,18 @@ void PortMgr::doTask(Consumer &consumer)
if (fvField(i) == "mtu")
{
mtu = fvValue(i);
if (!portOk)
{
field_values.emplace_back(i);
}
}
else if (fvField(i) == "admin_status")
{
admin_status = fvValue(i);
if (!portOk)
{
field_values.emplace_back(i);
}
}
else
{
Expand All @@ -203,8 +211,6 @@ void PortMgr::doTask(Consumer &consumer)
{
SWSS_LOG_WARN("Port %s is not ready, pending...", alias.c_str());

writeConfigToAppDb(alias, "mtu", mtu);
writeConfigToAppDb(alias, "admin_status", admin_status);
/* Retry setting these params after the netdev is created */
field_values.clear();
field_values.emplace_back("mtu", mtu);
Expand Down

0 comments on commit b460a3a

Please sign in to comment.