Skip to content

Commit

Permalink
Revert "Refine getDbId() calling to fix build after swss-common change (
Browse files Browse the repository at this point in the history
sonic-net#1245)"

This reverts commit fb5c1aa.
  • Loading branch information
abdosi committed Aug 2, 2020
1 parent 959f260 commit 5cc05e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion orchagent/orch.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Consumer : public Executor {

int getDbId() const
{
return getConsumerTable()->getDbConnector()->getDbId();
return getConsumerTable()->getDbId();
}

std::string dumpTuple(swss::KeyOpFieldsValuesTuple &tuple);
Expand Down
1 change: 0 additions & 1 deletion tests/mock_tests/mock_dbconnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ namespace swss
}

DBConnector::DBConnector(const std::string& dbName, unsigned int timeout, bool isTcpConn)
: m_dbName(dbName)
{
if (swss::SonicDBConfig::isInit() == false)
swss::SonicDBConfig::initialize("./database_config.json");
Expand Down
8 changes: 4 additions & 4 deletions tests/mock_tests/mock_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace swss

bool Table::get(const std::string &key, std::vector<FieldValueTuple> &ovalues)
{
auto table = gDB[m_pipe->getDbId()][getTableName()];
auto table = gDB[getDbId()][getTableName()];
if (table.find(key) == table.end())
{
return false;
Expand All @@ -35,7 +35,7 @@ namespace swss

bool Table::hget(const std::string &key, const std::string &field, std::string &value)
{
auto table = gDB[m_pipe->getDbId()][getTableName()];
auto table = gDB[getDbId()][getTableName()];
if (table.find(key) == table.end())
{
return false;
Expand All @@ -58,14 +58,14 @@ namespace swss
const std::string &op,
const std::string &prefix)
{
auto &table = gDB[m_pipe->getDbId()][getTableName()];
auto &table = gDB[getDbId()][getTableName()];
table[key] = values;
}

void Table::getKeys(std::vector<std::string> &keys)
{
keys.clear();
auto table = gDB[m_pipe->getDbId()][getTableName()];
auto table = gDB[getDbId()][getTableName()];
for (const auto &it : table)
{
keys.push_back(it.first);
Expand Down

0 comments on commit 5cc05e3

Please sign in to comment.