Don't commit the error during getting of DHCP value

When network manager comes up, it parses the file to
get the dhcp value from the config file,if DHCP key is
not there then don't commit the error.

Resolves openbmc/openbmc#2011

Change-Id: Ic86454a3502096cae2edbb9afe917f5567aa84a6
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/config_parser.cpp b/config_parser.cpp
index 51ef55b..9ab601c 100644
--- a/config_parser.cpp
+++ b/config_parser.cpp
@@ -78,17 +78,21 @@
                       const std::string& value)
 {
     KeyValues values;
-    try
+    auto it = sections.find(section);
+    if (it != sections.end())
     {
-        values = getSection(section);
+        values = std::move(it->second);
     }
-    catch (InternalFailure& e)
-    {
-        // don't commit the error.
+    values.insert(std::make_pair(key, value));
 
+    if (it != sections.end())
+    {
+        it->second = std::move(values);
     }
-    values.emplace(key, value);
-    sections.emplace(section, values);
+    else
+    {
+        sections.insert(std::make_pair(section, std::move(values)));
+    }
 }
 
 #if 0
diff --git a/network_manager.cpp b/network_manager.cpp
index e9a62ed..013a61b 100644
--- a/network_manager.cpp
+++ b/network_manager.cpp
@@ -267,7 +267,7 @@
     }
     catch (InternalFailure& e)
     {
-        commit<InternalFailure>();
+       log<level::INFO>("Exception occured during getting of DHCP value");
     }
     return dhcp;
 }