Fix host state checking logic
Resolves openbmc/bmcweb#12
Testing: Verified this with system booted against
redfish/v1/Systems/motherboard:
"PowerState": "On",
"Status": {
"State": "Enabled"
},
and this with system powered off:
"PowerState": "Off",
"Status": {
"State": "Disabled"
},
Change-Id: I0acbf0992d730e4a5189d9af962370277f59eaaa
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index ebe455e..3d7c931 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -460,7 +460,7 @@
if (s != nullptr)
{
// Verify Host State
- if (*s == "xyz.openbmc_project.State.Host.Running")
+ if (*s == "xyz.openbmc_project.State.Host.HostState.Running")
{
aResp->res.jsonValue["PowerState"] = "On";
aResp->res.jsonValue["Status"]["State"] = "Enabled";