summaryrefslogtreecommitdiffstats
path: root/pychassisctl
diff options
context:
space:
mode:
authorYi Li <adamliyi@msn.com>2016-07-02 22:29:45 +0800
committerPatrick Williams <patrick@stwcx.xyz>2016-08-08 20:02:22 +0000
commit4eab1dc7aa2486f251b5235a21851740eec8a733 (patch)
tree614c8b559657eade9aae5a216cae992c58c4c60b /pychassisctl
parentfb4d22587fdc46d64c253a1ab1b40b228a8c0887 (diff)
downloadtalos-skeleton-4eab1dc7aa2486f251b5235a21851740eec8a733.tar.gz
talos-skeleton-4eab1dc7aa2486f251b5235a21851740eec8a733.zip
chassis_control: Log an event when emergency shutdown host
According to BMC Firmware Specification, on occasion the BMC will be required to shut down the host due to high ambient or fan fails. A SEL must be present in this case. Fixes openbmc/skeleton#64 Change-Id: I3d779fc597961821a7a7f1b0f147314072ae8802 Signed-off-by: Yi Li <adamliyi@msn.com>
Diffstat (limited to 'pychassisctl')
-rwxr-xr-xpychassisctl/chassis_control.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/pychassisctl/chassis_control.py b/pychassisctl/chassis_control.py
index fc18703..b3e16ff 100755
--- a/pychassisctl/chassis_control.py
+++ b/pychassisctl/chassis_control.py
@@ -229,8 +229,23 @@ class ChassisControlObject(DbusProperties, DbusObjectManager):
self.Set(DBUS_NAME, "reboot", 1)
self.powerOff()
- def emergency_shutdown_signal_handler(self):
+ def emergency_shutdown_signal_handler(self, message):
print "Emergency Shutdown!"
+ # Log an event.
+ try:
+ # Exception happens or not, we need to power off.
+ obj = bus.get_object("org.openbmc.records.events",
+ "/org/openbmc/records/events",
+ introspect=False)
+ intf = dbus.Interface(obj, "org.openbmc.recordlog")
+ desc = message
+ sev = "critical error"
+ details = "Get emergency shutdown signal. Shutdown the host."
+ debug = dbus.ByteArray("")
+ intf.acceptBMCMessage(desc, sev, details, debug)
+ except Exception as e:
+ print "Emergency shutdown signal handler: log event error."
+ print e
self.powerOff()
OpenPOWER on IntegriCloud