summaryrefslogtreecommitdiffstats
path: root/pyflashbmc/bmc_update.py
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2018-04-04 16:51:22 +0800
committerLei YU <mine260309@gmail.com>2018-04-04 16:52:56 +0800
commit5a38763fcd44cdcf7390174423790a50bf76d091 (patch)
tree4e48cb963cc16d6b43e8e49376c0f489f3f90a8e /pyflashbmc/bmc_update.py
parentd1142e346da97ba6681122b6c27ae1e09e8f314d (diff)
downloadblackbird-skeleton-5a38763fcd44cdcf7390174423790a50bf76d091.tar.gz
blackbird-skeleton-5a38763fcd44cdcf7390174423790a50bf76d091.zip
bmc_update.py: Use BMC state manager to reboot BMC
It was using BMC control service to call warmReset() to reboot BMC. But now legacy BMC control service is removed so the call will fail. Use BMC state manager instead to trigger BMC reboot. Partially resolves openbmc/openbmc#3064. Tested: Run legacy code update and verify PrepareForupdate() does reboot the BMC. Change-Id: I9f0fcddce9fb8f4007db0dd17b3cd3840c8848fc Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'pyflashbmc/bmc_update.py')
-rw-r--r--pyflashbmc/bmc_update.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pyflashbmc/bmc_update.py b/pyflashbmc/bmc_update.py
index 8c5936e..98c3ca6 100644
--- a/pyflashbmc/bmc_update.py
+++ b/pyflashbmc/bmc_update.py
@@ -19,8 +19,8 @@ DBUS_NAME = 'org.openbmc.control.BmcFlash'
OBJ_NAME = '/org/openbmc/control/flash/bmc'
DOWNLOAD_INTF = 'org.openbmc.managers.Download'
-BMC_DBUS_NAME = 'org.openbmc.control.Bmc'
-BMC_OBJ_NAME = '/org/openbmc/control/bmc0'
+BMC_DBUS_NAME = 'xyz.openbmc_project.State.BMC'
+BMC_OBJ_NAME = '/xyz/openbmc_project/state/bmc0'
UPDATE_PATH = '/run/initramfs'
@@ -317,8 +317,10 @@ class BmcFlashControl(DbusProperties, DbusObjectManager):
"copy-files-to-ram copy-base-filesystem-to-ram"])
self.Set(DBUS_NAME, "status", "Switch to update mode in progress")
o = bus.get_object(BMC_DBUS_NAME, BMC_OBJ_NAME)
- intf = dbus.Interface(o, BMC_DBUS_NAME)
- intf.warmReset()
+ intf = dbus.Interface(o, "org.freedesktop.DBus.Properties")
+ intf.Set(BMC_DBUS_NAME,
+ "RequestedBMCTransition",
+ "xyz.openbmc_project.State.BMC.Transition.Reboot")
if __name__ == '__main__':
OpenPOWER on IntegriCloud