summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@linux.vnet.ibm.com>2019-03-07 18:39:25 +0300
committerEd Tanous <ed.tanous@intel.com>2019-03-13 02:29:40 +0300
commit82fd90f0550794f8f93877dfc7cfdb0aa3124ece (patch)
tree91bcf628ce24b888a9ae771545c09a0b3f5e91a5
parentf15aad376977bd1cef50854b5b1c39d27b026496 (diff)
downloadbmcweb-82fd90f0550794f8f93877dfc7cfdb0aa3124ece.tar.xz
Redfish(Ethernet): Fix to not convert the json index into string
During Property Update for the Ipv4address, Index was getting converted into string which was causing the bmcweb to crash. This commit fixes this problem. TestedBy: Assumption: There is already three IP address and updating the third one. PATCH -D patch.txt -d '{"IPv4Addresses": [{},{},{"Address": "x.x.x.x","AddressOrigin": "Static","SubnetMask": "255.255.0.0","Gateway":"x.x.x.x"}]} Change-Id: Ic055649b75aaa36e16bda5d8dc4e4e9c87dcb315 Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
-rw-r--r--redfish-core/lib/ethernet.hpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 0bfe9db5df..8d7eddc9e8 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1019,9 +1019,9 @@ class EthernetInterface : public Node
messages::internalError(asyncResp->res);
return;
}
- asyncResp->res
- .jsonValue["IPv4Addresses"][std::to_string(
- entryIdx)]["Address"] = address;
+ asyncResp->res.jsonValue["IPv4Addresses"]
+ [entryIdx]["Address"] =
+ address;
};
crow::connections::systemBus->async_method_call(
@@ -1058,9 +1058,8 @@ class EthernetInterface : public Node
messages::internalError(asyncResp->res);
return;
}
- asyncResp->res
- .jsonValue["IPv4Addresses"][std::to_string(
- entryIdx)]["Gateway"] =
+ asyncResp->res.jsonValue["IPv4Addresses"]
+ [entryIdx]["Gateway"] =
std::move(gateway);
};