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>
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 @@
 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 @@
             "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__':