summaryrefslogtreecommitdiffstats
path: root/phosphor-ldap-config/ldap_configuration.cpp
diff options
context:
space:
mode:
authorNagaraju Goruganti <ngorugan@in.ibm.com>2018-09-18 09:55:09 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-10-04 15:14:12 -0400
commit24194bd9672083de9eb4a33ff8e8369b46f823bf (patch)
tree179ae467f074375e062bed872073e22b398ea85b /phosphor-ldap-config/ldap_configuration.cpp
parentf1940d9e431eecfd900b2532d1255709fa416814 (diff)
downloadphosphor-user-manager-24194bd9672083de9eb4a33ff8e8369b46f823bf.tar.gz
phosphor-user-manager-24194bd9672083de9eb4a33ff8e8369b46f823bf.zip
phosphor-ldap-conf: Implement the Delete interface
Implement the xyz.openbmc_project.Object.Delete interface to delete LDAP config object. Change-Id: Ia7413fd10c91ad5c79286fbe4a00740ced42aad6 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
Diffstat (limited to 'phosphor-ldap-config/ldap_configuration.cpp')
-rw-r--r--phosphor-ldap-config/ldap_configuration.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/phosphor-ldap-config/ldap_configuration.cpp b/phosphor-ldap-config/ldap_configuration.cpp
index 6680541..3a4ed2e 100644
--- a/phosphor-ldap-config/ldap_configuration.cpp
+++ b/phosphor-ldap-config/ldap_configuration.cpp
@@ -40,6 +40,11 @@ Config::Config(sdbusplus::bus::bus& bus, const char* path, const char* filePath,
this->emit_object_added();
}
+void Config::delete_()
+{
+ parent.deleteObject();
+}
+
void Config::writeConfig()
{
std::stringstream confData;
@@ -320,6 +325,11 @@ void ConfigMgr::restartService(const std::string& service)
}
}
+void ConfigMgr::deleteObject()
+{
+ configPtr.reset(nullptr);
+}
+
std::string
ConfigMgr::createConfig(bool secureLDAP, std::string lDAPServerURI,
std::string lDAPBindDN, std::string lDAPBaseDN,
@@ -329,7 +339,7 @@ std::string
{
// TODO Validate parameters passed-in.
// With current implementation we support only one LDAP server.
- configPtr.reset(nullptr);
+ deleteObject();
auto objPath = std::string(LDAP_CONFIG_DBUS_OBJ_PATH);
configPtr = std::make_unique<Config>(
OpenPOWER on IntegriCloud