bmcweb: Fix empty response when do the clearLog
Upstream:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/66274
It won't show anything when do the POST
/redfish/v1/Systems/<str>/LogServices/PostCodes/Actions/LogService.ClearLog
Give a response which same as
/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog
Tested:
curl -k -X POST http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Actions/LogService.ClearLog
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.13.0.Success",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
Change-Id: I4bc928a6a9b8a2c2577af6d544e108d27940971e
Signed-off-by: Tony Lee <tony.lee@quanta.corp-partner.google.com>
diff --git a/recipes-phosphor/interfaces/bmcweb/fixEmptyResponse.patch b/recipes-phosphor/interfaces/bmcweb/fixEmptyResponse.patch
new file mode 100644
index 0000000..1fcb9be
--- /dev/null
+++ b/recipes-phosphor/interfaces/bmcweb/fixEmptyResponse.patch
@@ -0,0 +1,12 @@
+diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
+index 9594c9530c..63ce6e1d74 100644
+--- a/redfish-core/lib/log_services.hpp
++++ b/redfish-core/lib/log_services.hpp
+@@ -3741,6 +3741,7 @@ inline void requestRoutesPostCodesClear(App& app)
+ messages::internalError(asyncResp->res);
+ return;
+ }
++ messages::success(asyncResp->res);
+ },
+ "xyz.openbmc_project.State.Boot.PostCode0",
+ "/xyz/openbmc_project/State/Boot/PostCode0",
diff --git a/recipes-phosphor/interfaces/bmcweb_%.bbappend b/recipes-phosphor/interfaces/bmcweb_%.bbappend
index 61c3e59..73fc837 100644
--- a/recipes-phosphor/interfaces/bmcweb_%.bbappend
+++ b/recipes-phosphor/interfaces/bmcweb_%.bbappend
@@ -96,6 +96,7 @@
file://0022-bmcweb-Add-RelatedItem-to-DIMM-sensors.patch \
file://0001-Fix-RelatedItems-when-fetching-individual-sensors.patch \
file://DOWNSTREAM_0047-Enable-PCIe-Slots-implementation.patch \
+ file://fixEmptyResponse.patch \
"
misc_patches:gbmcfork = ""
SRC_URI:append:gbmc = "${misc_patches}"