Skip to content

Commit 5cc05e3

Browse files
committed
Revert "Refine getDbId() calling to fix build after swss-common change (sonic-net#1245)"
This reverts commit fb5c1aa.
1 parent 959f260 commit 5cc05e3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

orchagent/orch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class Consumer : public Executor {
128128

129129
int getDbId() const
130130
{
131-
return getConsumerTable()->getDbConnector()->getDbId();
131+
return getConsumerTable()->getDbId();
132132
}
133133

134134
std::string dumpTuple(swss::KeyOpFieldsValuesTuple &tuple);

tests/mock_tests/mock_dbconnector.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace swss
3939
}
4040

4141
DBConnector::DBConnector(const std::string& dbName, unsigned int timeout, bool isTcpConn)
42-
: m_dbName(dbName)
4342
{
4443
if (swss::SonicDBConfig::isInit() == false)
4544
swss::SonicDBConfig::initialize("./database_config.json");

tests/mock_tests/mock_table.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace swss
2323

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

3636
bool Table::hget(const std::string &key, const std::string &field, std::string &value)
3737
{
38-
auto table = gDB[m_pipe->getDbId()][getTableName()];
38+
auto table = gDB[getDbId()][getTableName()];
3939
if (table.find(key) == table.end())
4040
{
4141
return false;
@@ -58,14 +58,14 @@ namespace swss
5858
const std::string &op,
5959
const std::string &prefix)
6060
{
61-
auto &table = gDB[m_pipe->getDbId()][getTableName()];
61+
auto &table = gDB[getDbId()][getTableName()];
6262
table[key] = values;
6363
}
6464

6565
void Table::getKeys(std::vector<std::string> &keys)
6666
{
6767
keys.clear();
68-
auto table = gDB[m_pipe->getDbId()][getTableName()];
68+
auto table = gDB[getDbId()][getTableName()];
6969
for (const auto &it : table)
7070
{
7171
keys.push_back(it.first);

0 commit comments

Comments
 (0)