File bsc#1121808-0001-Test-cts-exec-still-run-the-tests-for-the-other-reso-1.1.patch of Package pacemaker.14737
From b88c6f1907011fcad21a38bdef38c78962a1c4c9 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 11 Jan 2019 11:43:49 +0100
Subject: [PATCH] Test: cts-exec: still run the tests for the other resource
classes even without python systemd bindings
---
lrmd/regression.py.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: pacemaker/lrmd/regression.py.in
===================================================================
--- pacemaker.orig/lrmd/regression.py.in
+++ pacemaker/lrmd/regression.py.in
@@ -246,7 +246,12 @@ class Tests:
# script to run. Otherwise, running without this import being
# available will make all the systemd tests look like they fail,
# which is really scary looking. I'd rather see the import fail.
- import systemd.daemon
+ try:
+ import systemd.daemon
+ except ImportError:
+ print("Python systemd bindings not found.")
+ print("The tests for systemd class are not going to be run.")
+ self.rsc_classes.remove("systemd")
print "Testing "+repr(self.rsc_classes)