Skip to content

Commit 80107d5

Browse files
committed
Fix Errors found during CI
1 parent 3db2c1b commit 80107d5

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

redfish-core/include/utils/error_log_utils.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ namespace error_log_utils
2626
* might delete by the user via Redfish but, we should not throw
2727
* internal error in that case, just log trace and return.
2828
*/
29-
inline void setErrorLogUri(
30-
const std::shared_ptr<bmcweb::AsyncResp>& aResp,
31-
const sdbusplus::message::object_path& errorLogObjPath,
32-
const nlohmann::json_pointer<nlohmann::json>& errorLogPropPath,
33-
const bool isLink)
29+
inline void
30+
setErrorLogUri(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
31+
const sdbusplus::message::object_path& errorLogObjPath,
32+
const nlohmann::json::json_pointer& errorLogPropPath,
33+
const bool isLink)
3434
{
3535
// Get the Hidden Property
3636
crow::connections::systemBus->async_method_call(

redfish-core/include/utils/hw_isolation.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ inline void
132132
"InvalidArgument") == 0)
133133
{
134134
messages::propertyValueExternalConflict(
135-
aResp->res, "Enabled", std::to_string(enabledPropVal));
135+
aResp->res, "Enabled", std::to_string(enabledPropVal ? 1 : 0));
136136
}
137137
else if (strcmp(dbusError->name, "xyz.openbmc_project.Common.Error."
138138
"NotAllowed") == 0)
@@ -143,8 +143,9 @@ inline void
143143
"HardwareIsolation.Error."
144144
"IsolatedAlready") == 0)
145145
{
146-
messages::resourceAlreadyExists(aResp->res, resourceName, "Enabled",
147-
std::to_string(enabledPropVal));
146+
messages::resourceAlreadyExists(
147+
aResp->res, resourceName, "Enabled",
148+
std::to_string(enabledPropVal ? 1 : 0));
148149
}
149150
else if (strcmp(dbusError->name, "xyz.openbmc_project.Common.Error."
150151
"TooManyResources") == 0)
@@ -419,11 +420,10 @@ inline void processHardwareIsolationReq(
419420
* @return True on success
420421
* False on failure and set the error in the redfish response.
421422
*/
422-
inline bool
423-
setSeverity(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
424-
const sdbusplus::message::object_path& objPath,
425-
const nlohmann::json_pointer<nlohmann::json>& severityPropPath,
426-
const std::string& severityVal)
423+
inline bool setSeverity(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
424+
const sdbusplus::message::object_path& objPath,
425+
const nlohmann::json::json_pointer& severityPropPath,
426+
const std::string& severityVal)
427427
{
428428
if (severityVal == "xyz.openbmc_project.Logging.Event."
429429
"SeverityLevel.Critical")
@@ -607,7 +607,7 @@ inline void
607607
sdbusplus::message::object_path errPath =
608608
std::get<2>(assoc);
609609
// we have only one condition
610-
nlohmann::json_pointer logEntryPropPath =
610+
nlohmann::json::json_pointer logEntryPropPath =
611611
"/Status/Conditions/0/LogEntry"_json_pointer;
612612
error_log_utils::setErrorLogUri(
613613
aResp, errPath, logEntryPropPath, true);
@@ -702,7 +702,7 @@ inline void
702702
}
703703

704704
// we have only one condition
705-
nlohmann::json_pointer severityPropPath =
705+
nlohmann::json::json_pointer severityPropPath =
706706
"/Status/Conditions/0/Severity"_json_pointer;
707707
if (!setSeverity(aResp, hwStatusEventObj,
708708
severityPropPath, *severity))

redfish-core/include/utils/name_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ inline void getPrettyName(
5555

5656
const std::string* value = std::get_if<std::string>(&prettyName);
5757

58-
if (!value)
58+
if (value == nullptr)
5959
{
6060

6161
BMCWEB_LOG_ERROR << "Failed to get Pretty Name for " << path;

redfish-core/lib/assembly.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ inline void fillWithAssemblyId(
921921
const std::string& assemblyParentServ,
922922
const sdbusplus::message::object_path& assemblyParentObjPath,
923923
const std::string& assemblyParentIface,
924-
const nlohmann::json_pointer<nlohmann::json>& assemblyUriPropPath,
924+
const nlohmann::json::json_pointer& assemblyUriPropPath,
925925
const sdbusplus::message::object_path& assembledObjPath,
926926
const std::string& assembledUriVal)
927927
{

redfish-core/lib/processor.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ inline void getProcessorPaths(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
900900
const std::string& processorId, Handler&& handler)
901901
{
902902
crow::connections::systemBus->async_method_call(
903-
[processorId, aResp, handler{std::move(handler)}](
903+
[processorId, aResp, handler{std::forward<Handler>(handler)}](
904904
const boost::system::error_code ec,
905905
const std::vector<std::string>& subTreePaths) {
906906
if (ec)
@@ -1035,7 +1035,7 @@ inline void
10351035
}
10361036
}
10371037

1038-
if (present == false)
1038+
if (!present)
10391039
{
10401040
aResp->res.jsonValue["Status"]["State"] = "Absent";
10411041
}
@@ -1113,7 +1113,7 @@ inline void getSubProcessorData(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
11131113
return;
11141114
}
11151115

1116-
if (subtree.size() != 0)
1116+
if (!subtree.empty())
11171117
{
11181118
// Object not found
11191119
messages::resourceNotFound(

0 commit comments

Comments
 (0)