diff options
| author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-08-02 18:09:25 +0530 |
|---|---|---|
| committer | Ratan Gupta <ratagupt@in.ibm.com> | 2017-08-10 23:58:14 +0530 |
| commit | dea3ead09a1503daec471d8ed4d24d20bb489451 (patch) | |
| tree | c9174cac5b3771d26c02faf613a2e34eafea5106 | |
| parent | 70c7e5b5f4fa01308f89266142aa1c4fc8181231 (diff) | |
| download | phosphor-networkd-dea3ead09a1503daec471d8ed4d24d20bb489451.tar.gz phosphor-networkd-dea3ead09a1503daec471d8ed4d24d20bb489451.zip | |
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>
| -rw-r--r-- | config_parser.cpp | 18 | ||||
| -rw-r--r-- | network_manager.cpp | 2 |
2 files changed, 12 insertions, 8 deletions
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 @@ void Parser::setValue(const std::string& section, const std::string& key, 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); + } + else + { + sections.insert(std::make_pair(section, std::move(values))); } - values.emplace(key, value); - sections.emplace(section, 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 @@ bool Manager::getDHCPValue(const std::string& intf) } catch (InternalFailure& e) { - commit<InternalFailure>(); + log<level::INFO>("Exception occured during getting of DHCP value"); } return dhcp; } |

