Update D-Bus names per design
- Single-host service and object are named PostCode0. Multi-host service
name does not comply with design but presumably it will be fixed in
the future.
Tested: With
phosphor-host-postd: I89ab5f2eef7eab59823df3a063414f3ca3b2949f
bmcweb: I2fdf97b7aaf8d6471d162f8ed1b72143491ac23f
Power cycled host and verified that new POST codes are added under
/redfish/v1/Systems/system/LogServices/PostCodes/Entries.
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: I59ed514f28c2bb9b159f51367c38557bf55bf226
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce94929..2cce209 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-set(DBUS_OBJECT_NAME "xyz/openbmc_project/State/Boot/PostCode")
+set(DBUS_OBJECT_NAME "xyz/openbmc_project/State/Boot/PostCode0")
set(DBUS_INTF_NAME "xyz.openbmc_project.State.Boot.PostCode")
add_definitions(-DDBUS_OBJECT_NAME="/${DBUS_OBJECT_NAME}")
diff --git a/service_files/xyz.openbmc_project.State.Boot.PostCode.service b/service_files/xyz.openbmc_project.State.Boot.PostCode.service
index 4246472..35ffd1f 100644
--- a/service_files/xyz.openbmc_project.State.Boot.PostCode.service
+++ b/service_files/xyz.openbmc_project.State.Boot.PostCode.service
@@ -2,10 +2,10 @@
Description=Post code manager
[Service]
-ExecStart=/usr/bin/env post-code-manager
+ExecStart=/usr/bin/post-code-manager --host 0
SyslogIdentifier=post-code-manager
Type=dbus
-BusName=xyz.openbmc_project.State.Boot.PostCode
+BusName=xyz.openbmc_project.State.Boot.PostCode0
[Install]
WantedBy=multi-user.target
diff --git a/src/main.cpp b/src/main.cpp
index 016659f..2cdb490 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -60,14 +60,7 @@
sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
sdbusplus::server::manager_t m{bus, DBUS_OBJECT_NAME};
- if (postcodeDataHolderObj->node == 0)
- {
- intfName = DBUS_INTF_NAME;
- }
- else
- {
- intfName = DBUS_INTF_NAME + std::to_string(postcodeDataHolderObj->node);
- }
+ intfName = DBUS_INTF_NAME + std::to_string(postcodeDataHolderObj->node);
bus.request_name(intfName.c_str());