Unify item creation/deletion in datastore access
All of our implementations are using the same implementation; all of the
smartness is actually in sysrepo or in libyang. As a bonus, this should
make it possible to remove regular leafs as well (backend-wise at
least).
Change-Id: I177cd233b4b699f66475eae735a659b7c8577534
diff --git a/src/sysrepo_access.cpp b/src/sysrepo_access.cpp
index 7b9cb7a..70b8823 100644
--- a/src/sysrepo_access.cpp
+++ b/src/sysrepo_access.cpp
@@ -235,7 +235,7 @@
}
}
-void SysrepoAccess::createPresenceContainer(const std::string& path)
+void SysrepoAccess::createItem(const std::string& path)
{
try {
m_session->set_item(path.c_str());
@@ -244,43 +244,7 @@
}
}
-void SysrepoAccess::deletePresenceContainer(const std::string& path)
-{
- try {
- m_session->delete_item(path.c_str());
- } catch (sysrepo::sysrepo_exception& ex) {
- reportErrors();
- }
-}
-
-void SysrepoAccess::createLeafListInstance(const std::string& path)
-{
- try {
- m_session->set_item(path.c_str());
- } catch (sysrepo::sysrepo_exception& ex) {
- reportErrors();
- }
-}
-
-void SysrepoAccess::deleteLeafListInstance(const std::string& path)
-{
- try {
- m_session->delete_item(path.c_str());
- } catch (sysrepo::sysrepo_exception& ex) {
- reportErrors();
- }
-}
-
-void SysrepoAccess::createListInstance(const std::string& path)
-{
- try {
- m_session->set_item(path.c_str());
- } catch (sysrepo::sysrepo_exception& ex) {
- reportErrors();
- }
-}
-
-void SysrepoAccess::deleteListInstance(const std::string& path)
+void SysrepoAccess::deleteItem(const std::string& path)
{
try {
m_session->delete_item(path.c_str());