chassis-state-manager: Correct poweroff state Unit
Previous commit changes the poweroff state unit to
"obmc-chassis-hard-poweroff@N.target" in accident,
currentPowerState should be set to Off if
"obmc-chassis-poweroff@N.target" be activated
correct it back to "obmc-chassis-poweroff@{}.target"
Tested on Bletchley Platform:
root@bletchley:# systemctl start obmc-chassis-poweroff@1.target
root@bletchley:# journalctl -u xyz.openbmc_project.State.Chassis@1.service
Mar 23 08:31:02 bletchley phosphor-chassis-state-manager[15189]: Received signal that power OFF is complete
Mar 23 08:31:02 bletchley phosphor-chassis-state-manager[15189]: Change to Chassis Power State: xyz.openbmc_project.State.Chassis.PowerState.Off
Change-Id: I6464f92184147a7e1e72e408053848342eece801
Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index 7acbef5..310b817 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -413,7 +413,7 @@
return 0;
}
- if ((newStateUnit == systemdTargetTable[Transition::Off]) &&
+ if ((newStateUnit == fmt::format(CHASSIS_STATE_POWEROFF_TGT_FMT, id)) &&
(newStateResult == "done") &&
(!stateActive(systemdTargetTable[Transition::On])))
{