diff options
author | Ed Tanous <edtanous@google.com> | 2022-06-27 23:17:35 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-06-13 20:48:37 +0300 |
commit | f818b04dad9601ca620a4afabadc83faa1c29735 (patch) | |
tree | baf208c16f2ddced7227dece2ef72ff5b384e4af /redfish-core/lib/hypervisor_system.hpp | |
parent | 2e8c4bda9c4b2809ca76bb227f818592515a3e4a (diff) | |
download | bmcweb-f818b04dad9601ca620a4afabadc83faa1c29735.tar.xz |
Make propertyValueFormatError more typesafe
Similar to other patches, make propertyValueFormatError accept a
nlohmann::json object, which removes a lot of the unsafe dump code that
we have littered about.
Tested: No easy to replicate error. Code is identical to previous
patchsets. Inspection and code compilation only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic9d0f196b6e198073189f744b738db7ffa2f1b74
Diffstat (limited to 'redfish-core/lib/hypervisor_system.hpp')
-rw-r--r-- | redfish-core/lib/hypervisor_system.hpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp index 5a7105fc3e..52aeb4330a 100644 --- a/redfish-core/lib/hypervisor_system.hpp +++ b/redfish-core/lib/hypervisor_system.hpp @@ -588,11 +588,8 @@ inline void handleHypervisorIPv4StaticPatch( address, "SubnetMask", subnetMask, "Gateway", gateway)) { - messages::propertyValueFormatError( - asyncResp->res, - thisJson.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace), - pathString); + messages::propertyValueFormatError(asyncResp->res, thisJson, + pathString); return; } @@ -893,11 +890,8 @@ inline void handleHypervisorEthernetInterfacePatch( // One and only one hypervisor instance supported if (ipv4Static.size() != 1) { - messages::propertyValueFormatError( - asyncResp->res, - ipv4Static.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace), - "IPv4StaticAddresses"); + messages::propertyValueFormatError(asyncResp->res, ipv4Static, + "IPv4StaticAddresses"); return; } |