File 0001-Test-cts-use-bash-in-the-pacemaker-cts-dummyd.patch of Package pacemaker.26927
From 29022ab490714f0b9e92678f7d7ab45bcdf11d1a Mon Sep 17 00:00:00 2001
From: Aleksei Burlakov <aleksei.burlakov@suse.com>
Date: Wed, 5 Dec 2018 14:56:07 +0100
Subject: [PATCH] Test: cts: use bash in the pacemaker-cts-dummyd
systemd.daemon requires the systemd python library which is provided
by neither of SUSE Enterprise Linux. If systemd.daemon cannot be
imported, use the bash subprocess.call instead of the systemd.daemon.notify
---
cts/pacemaker-cts-dummyd.in | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/cts/pacemaker-cts-dummyd.in b/cts/pacemaker-cts-dummyd.in
index fea4e6233..5df4695c5 100644
--- a/cts/pacemaker-cts-dummyd.in
+++ b/cts/pacemaker-cts-dummyd.in
@@ -11,7 +11,12 @@ __license__ = "GNU General Public License version 2 or later (GPLv2+) WITHOUT AN
import sys
import time
import signal
-import systemd.daemon
+import subprocess
+have_systemd_daemon = True
+try:
+ import systemd.daemon
+except ImportError:
+ have_systemd_daemon = False
delay = None
@@ -43,7 +48,10 @@ if __name__ == "__main__":
parse_args()
signal.signal(signal.SIGTERM, bye)
twiddle()
- systemd.daemon.notify("READY=1")
+ if have_systemd_daemon:
+ systemd.daemon.notify("READY=1")
+ else:
+ subprocess.call(["systemd-notify", "READY=1"])
# This isn't a "proper" daemon, but that would be overkill for testing purposes
while True:
--
2.16.4