Skip to content

Commit b6f9f1e

Browse files
committed
WIP: Simplify dbus service name creation
Non-indexed dbus service names for instance based daemons got deprecated. It is expected, that xyz.openbmc_project.State.Host0 and xyz.openbmc_project.State.Chassis0 exist on every single-host platform. Remove the multi-host check, and directly return an index based dbus service name. Tested: Manually checking if dbus service is picking up the requested ResetType / state transition interface. Before POST: ``` $ busctl introspect xyz.openbmc_project.State.Host0 \ /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Host interface - - ... .RequestedHostTransition property s "xyz.openbmc_project.State.Host.Transition.Off" ... ``` POST request: ``` $ curl -v -k POST 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/Systems/system/Actions/ComputerSystem.Reset' \ -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \ -H "Content-Type: application/json" -d {"ResetType":"On"} ``` After POST: ``` $ busctl introspect xyz.openbmc_project.State.Host0 \ /xyz/openbmc_project/state/host0 .RequestedHostTransition property s "xyz.openbmc_project.State.Host.Transition.On" ``` Change-Id: I5b2c37f9d6a622af0c056504e1bb6dd839fd7d14 Signed-off-by: Oliver Brewka <[email protected]>
1 parent 447d3ad commit b6f9f1e

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

redfish-core/include/utils/systems_utils.hpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,7 @@ inline sdbusplus::message::object_path getHostStateObjectPath(
226226

227227
inline std::string getHostStateServiceName(const uint64_t computerSystemIndex)
228228
{
229-
if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM)
230-
{
231-
return std::format("xyz.openbmc_project.State.Host{}",
232-
computerSystemIndex);
233-
}
234-
235-
return "xyz.openbmc_project.State.Host";
229+
return std::format("xyz.openbmc_project.State.Host{}", computerSystemIndex);
236230
}
237231

238232
inline sdbusplus::message::object_path getChassisStateObjectPath(
@@ -246,13 +240,8 @@ inline sdbusplus::message::object_path getChassisStateObjectPath(
246240
inline std::string getChassisStateServiceName(
247241
const uint64_t computerSystemIndex)
248242
{
249-
if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM)
250-
{
251-
return std::format("xyz.openbmc_project.State.Chassis{}",
252-
computerSystemIndex);
253-
}
254-
255-
return "xyz.openbmc_project.State.Chassis";
243+
return std::format("xyz.openbmc_project.State.Chassis{}",
244+
computerSystemIndex);
256245
}
257246

258247
inline sdbusplus::message::object_path getControlObjectPath(

0 commit comments

Comments
 (0)