summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-01-20 06:25:48 -0600
committerRaptor Engineering Development Team <support@raptorengineering.com>2018-01-20 06:25:48 -0600
commit914d683cf83051e2f22c4c0e81087118677e135f (patch)
treeeb61d0b2c730069a29e37d0948a51c0be9a559e4
parent6512bdcb99995b643c57896baad378439b46735b (diff)
downloadtalos-skeleton-914d683cf83051e2f22c4c0e81087118677e135f.tar.gz
talos-skeleton-914d683cf83051e2f22c4c0e81087118677e135f.zip
Add systemd trigger on IPL completion
-rw-r--r--pyiplobserver/ipl_status_observer.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pyiplobserver/ipl_status_observer.py b/pyiplobserver/ipl_status_observer.py
index 34e8f34..3d08b13 100644
--- a/pyiplobserver/ipl_status_observer.py
+++ b/pyiplobserver/ipl_status_observer.py
@@ -177,6 +177,16 @@ class IPLStatus(DbusProperties, DbusObjectManager):
if (self.prev_access_fail_count < 255):
self.prev_access_fail_count += 1
+ if ((current_status == "IPL_COMPLETE") and (self.last_status != current_status)):
+ # Signal systemd that IPL is complete
+ try:
+ systemd_emit_dev = self.bus.get_object("org.freedesktop.systemd1", u"/org/freedesktop/systemd1")
+ systemd_emit_iface = dbus.Interface(systemd_emit_dev, 'org.freedesktop.systemd1.Manager')
+ systemd_emit_function = getattr(systemd_emit_iface, 'StartUnit')
+ systemd_emit_function.call_async('obmc-host-ipl-complete@0.target', 'replace')
+ except Exception as e:
+ pass
+
# Since it is extremely unlikely that both fetches will fail unless the host is offline, simply check that both fetches passed or failed before continuing
if (sbe_fetch_failed == hostboot_fetch_failed):
# Check error results multiple times before signalling unexpected offline status
OpenPOWER on IntegriCloud