summaryrefslogtreecommitdiffstats
path: root/pystatemgr
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2016-12-20 10:00:30 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-01-30 20:53:50 +0000
commit57eea1bfc3ed9a36c7d6ce09208ed82f1afdd045 (patch)
treeefa26cfb53c83382c85b58dd9c7c301ee60ec232 /pystatemgr
parent25b9a85074168cf27e111adc3cd5e30b71a14b67 (diff)
downloadtalos-skeleton-57eea1bfc3ed9a36c7d6ce09208ed82f1afdd045.tar.gz
talos-skeleton-57eea1bfc3ed9a36c7d6ce09208ed82f1afdd045.zip
Move pystatemgr over to new host control interfaces
Change-Id: I15b8d0c01164bda44a725b99879eac2b036c69d1 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'pystatemgr')
-rw-r--r--pystatemgr/discover_system_state.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/pystatemgr/discover_system_state.py b/pystatemgr/discover_system_state.py
index f793314..e52017a 100644
--- a/pystatemgr/discover_system_state.py
+++ b/pystatemgr/discover_system_state.py
@@ -24,10 +24,10 @@ dbus_objects = {
'object_name': '/org/openbmc/sensors/host/BootProgress',
'interface_name': 'org.openbmc.SensorValue'
},
- 'chassis': {
- 'bus_name': 'org.openbmc.control.Chassis',
- 'object_name': '/org/openbmc/control/chassis0',
- 'interface_name': 'org.openbmc.control.Chassis'
+ 'host': {
+ 'bus_name': 'xyz.openbmc_project.State.Host',
+ 'object_name': '/xyz/openbmc_project/state/host0',
+ 'interface_name': 'xyz.openbmc_project.State.Host'
},
'settings': {
'bus_name': 'org.openbmc.settings.Host',
@@ -54,6 +54,11 @@ def getProperty(bus, objs, key, prop):
intf = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
return intf.Get(objs[key]['interface_name'], prop)
+def setProperty(bus, objs, key, prop, prop_value):
+ obj = bus.get_object(
+ objs[key]['bus_name'], objs[key]['object_name'])
+ intf = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
+ return intf.Set(objs[key]['interface_name'], prop, prop_value)
bus = dbus.SystemBus()
pgood = getProperty(bus, dbus_objects, 'power', 'pgood')
@@ -74,11 +79,11 @@ else:
power_policy = settings_intf.Get("org.openbmc.settings.Host",
"power_policy")
print "Last System State:"+system_last_state+"Power Policy:"+power_policy
- chassis_intf = getInterface(bus, dbus_objects, 'chassis')
if (power_policy == "ALWAYS_POWER_ON" or
(power_policy == "RESTORE_LAST_STATE" and
system_last_state == "HOST_POWERED_ON")):
- chassis_intf.powerOn()
+ setProperty(bus, dbus_objects, 'host', 'RequestedHostTransition',
+ 'xyz.openbmc_project.State.Host.Transition.On')
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
OpenPOWER on IntegriCloud