Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW-Isolation: Fix Additional Data Uri #1128

Open
wants to merge 1 commit into
base: 1110
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions redfish-core/lib/log_services.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7129,7 +7129,6 @@ inline void fillSystemHardwareIsolationLogEntry(

std::string guardType;

bool hiddenPEL = false;
// We need the severity details before getting the associations
// to fill the message details.
for (const auto& interface : dbusObjIt->second)
Expand Down Expand Up @@ -7161,7 +7160,6 @@ inline void fillSystemHardwareIsolationLogEntry(
"xyz.openbmc_project.HardwareIsolation.Entry.Type.Spare")
{
entryJson["Severity"] = "OK";
hiddenPEL = true;
}
}
}
Expand Down Expand Up @@ -7223,14 +7221,32 @@ inline void fillSystemHardwareIsolationLogEntry(
{
sdbusplus::message::object_path errPath =
std::get<2>(assoc);
std::string logPath = "EventLog";
if (hiddenPEL)
{
logPath = "CELog";
}
entryJson["AdditionalDataURI"] = boost::urls::format(
"/redfish/v1/Systems/system/LogServices/{}/Entries/{}/attachment",
logPath, errPath.filename());

std::string entryID = errPath.filename();

auto updateAdditionalDataURI = [asyncResp,
entryJsonIdx,
entryID](
bool hidden) {
nlohmann::json& entryJsonToupdateURI =
(entryJsonIdx > 0
? asyncResp->res
.jsonValue["Members"]
[entryJsonIdx - 1]
: asyncResp->res.jsonValue);
std::string logPath = "EventLog";

if (hidden)
{
logPath = "CELog";
}
entryJsonToupdateURI["AdditionalDataURI"] =
boost::urls::format(
"/redfish/v1/Systems/system/LogServices/{}/Entries/{}/attachment",
logPath, entryID);
};
getHiddenPropertyValue(asyncResp, entryID,
updateAdditionalDataURI);
}
}
}
Expand Down