[POC] POC code for show default value with yang model#595
[POC] POC code for show default value with yang model#595liuh-80 wants to merge 24 commits intosonic-net:masterfrom
Conversation
5f97c92 to
69a2af9
Compare
common/dbconnector.cpp
Outdated
| return shared_ptr<string>(NULL); | ||
| } | ||
|
|
||
| size_t pos = key.find("|"); |
There was a problem hiding this comment.
Fixed, now get separator from DBConnector.
common/dbconnector.cpp
Outdated
| return hget(key, field, false); | ||
| } | ||
|
|
||
| shared_ptr<string> DBConnector::hget(const string &key, const string &field, bool withDefaultValue) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Fixed by create a ConfigDBDecorator class and move this code to this class.
common/configdb.h
Outdated
| [[deprecated("Please use get_entry(std::string table, std::string key, bool withDefaultValue) instead.")]] | ||
| #endif | ||
| std::map<std::string, std::string> get_entry(std::string table, std::string key); | ||
| std::map<std::string, std::string> get_entry(std::string table, std::string key, bool withDefaultValue); |
There was a problem hiding this comment.
Will update this PR and design document according to your comments and discussion.
There was a problem hiding this comment.
Fixed, remove all new parameter and revert UT change.
|
this is one of key feature. do we have a design doc to review? |
Here is design document PR: https://github.com/Azure/SONiC/pull/989/files |
|
Build failed because we need libyang, however sonic version of patched libyang is in sonic-buildimage repo. |
common/dbconnector.cpp
Outdated
| if (reply->type == REDIS_REPLY_NIL) | ||
| { | ||
| return shared_ptr<string>(NULL); | ||
| auto dbdecortor = this->getDBDecorator(); |
There was a problem hiding this comment.
The reason does not create ConfigDBConnector but add code here is because DBinterface has following data member:
std::unordered_map<std::string, DBConnector> m_redisClient;
So, create a new derived class ConfigDBConnector need code change in this member and related code.
Will discussion if this is acceptable.
|
Close this PR, POC will move to: #625 |
No description provided.