Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cfgmgr] Fix for STATE_DB Port check logic in cfgmgr daemons #1936

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cfgmgr/intfmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "shellcmd.h"
#include "macaddress.h"
#include "warm_restart.h"
#include <swss/redisutility.h>

using namespace std;
using namespace swss;
Expand Down Expand Up @@ -438,6 +439,11 @@ bool IntfMgr::isIntfStateOk(const string &alias)
}
else if (m_statePortTable.get(alias, temp))
{
auto state_opt = swss::fvsGetValue(temp, "state", true);
if (!state_opt)
{
return false;
}
SWSS_LOG_DEBUG("Port %s is ready", alias.c_str());
return true;
}
Expand Down
7 changes: 7 additions & 0 deletions cfgmgr/portmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "portmgr.h"
#include "exec.h"
#include "shellcmd.h"
#include <swss/redisutility.h>

using namespace std;
using namespace swss;
Expand Down Expand Up @@ -87,6 +88,12 @@ bool PortMgr::isPortStateOk(const string &alias)

if (m_statePortTable.get(alias, temp))
{
auto state_opt = swss::fvsGetValue(temp, "state", true);
if (!state_opt)
{
return false;
}

SWSS_LOG_INFO("Port %s is ready", alias.c_str());
return true;
}
Expand Down
8 changes: 8 additions & 0 deletions cfgmgr/teammgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "tokenize.h"
#include "warm_restart.h"
#include "portmgr.h"
#include <swss/redisutility.h>

#include <algorithm>
#include <iostream>
Expand Down Expand Up @@ -72,6 +73,13 @@ bool TeamMgr::isPortStateOk(const string &alias)
return false;
}

auto state_opt = swss::fvsGetValue(temp, "state", true);
if (!state_opt)
{
SWSS_LOG_INFO("Port %s is not ready", alias.c_str());
return false;
}

return true;
}

Expand Down