Skip to content

Commit

Permalink
[vlanmgr]Fix for STATE_DB port check logic (sonic-net#1980)
Browse files Browse the repository at this point in the history
* Updated checks for PORT entry in STATE_DB in vlanmgrd additionally check for presence of "state" attribute. This is to add Vlanmgrd check similar to sonic-net#1936
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
  • Loading branch information
dgsudharsan authored Oct 28, 2021
1 parent 9ef2ba4 commit bfba0ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cfgmgr/vlanmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "tokenize.h"
#include "shellcmd.h"
#include "warm_restart.h"
#include <swss/redisutility.h>

using namespace std;
using namespace swss;
Expand Down Expand Up @@ -461,6 +462,11 @@ bool VlanMgr::isMemberStateOk(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("%s is ready", alias.c_str());
return true;
}
Expand Down

0 comments on commit bfba0ad

Please sign in to comment.