diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-07-10 02:24:22 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-10-11 02:25:26 +0300 |
commit | 271584ab78b4c1926f766aa26ddfde7da329059f (patch) | |
tree | 08001912ea542de88b9c31f5d53f195dedd56988 /redfish-core/lib/network_protocol.hpp | |
parent | 70ee8cbd4f3ec5b3e3c18967de221a9f3a70cd38 (diff) | |
download | bmcweb-271584ab78b4c1926f766aa26ddfde7da329059f.tar.xz |
Fix a bunch of warnings
using the list of warnings from here:
https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100
Seems like a good place to start, and would improve things a bit
type-wise. This patchset attempts to correct all the issues in one
shot.
Tested:
It builds. Will test various subsystems that have been touched
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: I588c26440e5a97f718a0f0ea74cc84107d53aa1e
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r-- | redfish-core/lib/network_protocol.hpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp index 71e58cc2c0..75d13d415e 100644 --- a/redfish-core/lib/network_protocol.hpp +++ b/redfish-core/lib/network_protocol.hpp @@ -139,7 +139,7 @@ void getEthernetIfaceData(CallbackFunc&& callback) }, "xyz.openbmc_project.Network", "/xyz/openbmc_project/network", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects"); -}; +} class NetworkProtocol : public Node { @@ -230,32 +230,32 @@ class NetworkProtocol : public Node // TODO Get eth0 interface data, and call the below callback for JSON // preparation - getEthernetIfaceData([this, hostName, asyncResp]( - const bool& success, - const std::vector<std::string>& ntpServers, - const std::vector<std::string>& domainNames) { - if (!success) - { - messages::resourceNotFound(asyncResp->res, "EthernetInterface", - "eth0"); - return; - } - asyncResp->res.jsonValue["NTP"]["NTPServers"] = ntpServers; - if (hostName.empty() == false) - { - std::string FQDN = std::move(hostName); - if (domainNames.empty() == false) + getEthernetIfaceData( + [hostName, asyncResp](const bool& success, + const std::vector<std::string>& ntpServers, + const std::vector<std::string>& domainNames) { + if (!success) { - FQDN += "." + domainNames[0]; + messages::resourceNotFound(asyncResp->res, + "EthernetInterface", "eth0"); + return; } - asyncResp->res.jsonValue["FQDN"] = std::move(FQDN); - } - }); + asyncResp->res.jsonValue["NTP"]["NTPServers"] = ntpServers; + if (hostName.empty() == false) + { + std::string FQDN = std::move(hostName); + if (domainNames.empty() == false) + { + FQDN += "." + domainNames[0]; + } + asyncResp->res.jsonValue["FQDN"] = std::move(FQDN); + } + }); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, - const std::vector<UnitStruct>& resp) { - if (ec) + [asyncResp](const boost::system::error_code e, + const std::vector<UnitStruct>& r) { + if (e) { asyncResp->res.jsonValue = nlohmann::json::object(); messages::internalError(asyncResp->res); @@ -265,7 +265,7 @@ class NetworkProtocol : public Node {"@odata.id", "/redfish/v1/Managers/bmc/NetworkProtocol/" "HTTPS/Certificates/"}}; - for (auto& unit : resp) + for (auto& unit : r) { for (auto& kv : protocolToDBus) { |