Create the default object for openldap and AD.

This commit introduces the following functionalities
=> Default AD and openldap config object would always be there.
=> User should not be able to change the type of the ldap
   once it is created.

This change is to align with redfish sehema
(https://redfish.dmtf.org/schemas/AccountService.v1_4_0.json),
In the schema AD and LDAP is a property which user can PATCH,
Now with the current code which doesn't have the default config
so for the PATCH, We were forcing the user to give all the
properties and then create the object which is against the
PATCH semantics.

TestedBy: Unit tested
          Default Object gets created when service starts.
          change of ldap type gets the error back.

Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
Change-Id: I0ce951a13ee525df022fb0716f0aea10d1909781
diff --git a/phosphor-ldap-config/ldap_config.cpp b/phosphor-ldap-config/ldap_config.cpp
index d10a711..cfa825c 100644
--- a/phosphor-ldap-config/ldap_config.cpp
+++ b/phosphor-ldap-config/ldap_config.cpp
@@ -20,6 +20,8 @@
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 namespace fs = std::filesystem;
 using Argument = xyz::openbmc_project::Common::InvalidArgument;
+using NotAllowed = sdbusplus::xyz::openbmc_project::Common::Error::NotAllowed;
+using NotAllowedArgument = xyz::openbmc_project::Common::NotAllowed;
 
 using Line = std::string;
 using Key = std::string;
@@ -380,28 +382,8 @@
 
 ConfigIface::Type Config::lDAPType(ConfigIface::Type value)
 {
-    ConfigIface::Type val;
-    try
-    {
-        if (value == lDAPType())
-        {
-            return value;
-        }
-
-        val = ConfigIface::lDAPType(value);
-        writeConfig();
-        parent.startOrStopService(nslcdService, enabled());
-    }
-    catch (const InternalFailure& e)
-    {
-        throw;
-    }
-    catch (const std::exception& e)
-    {
-        log<level::ERR>(e.what());
-        elog<InternalFailure>();
-    }
-    return val;
+    elog<NotAllowed>(NotAllowedArgument::REASON("ReadOnly Property"));
+    return lDAPType();
 }
 
 bool Config::enabled(bool value)