Blame SOURCES/bz1774458-fence_sbd-stderr-support.patch

66332a
From f37e5ba0b6c8dab527f947bfc602d50b953a7d08 Mon Sep 17 00:00:00 2001
66332a
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
66332a
Date: Tue, 17 Sep 2019 15:15:06 +0200
66332a
Subject: [PATCH] fence_sbd: support errors on stderr
66332a
66332a
---
66332a
 agents/sbd/fence_sbd.py | 5 +++--
66332a
 1 file changed, 3 insertions(+), 2 deletions(-)
66332a
66332a
diff --git a/agents/sbd/fence_sbd.py b/agents/sbd/fence_sbd.py
66332a
index b1df70ac..3ae8df6e 100644
66332a
--- a/agents/sbd/fence_sbd.py
66332a
+++ b/agents/sbd/fence_sbd.py
66332a
@@ -8,6 +8,7 @@
66332a
 from fencing import fail_usage, run_command, fence_action, all_opt
66332a
 from fencing import atexit_handler, check_input, process_input, show_docs
66332a
 from fencing import run_delay
66332a
+import itertools
66332a
 
66332a
 DEVICE_INIT = 1
66332a
 DEVICE_NOT_INIT = -3
66332a
@@ -82,7 +83,7 @@ def check_sbd_device(options, device_path):
66332a
 
66332a
     (return_code, out, err) = run_command(options, cmd)
66332a
 
66332a
-    for line in out.split("\n"):
66332a
+    for line in itertools.chain(out.split("\n"), err.split("\n")):
66332a
         if len(line) == 0:
66332a
             continue
66332a
 
66332a
@@ -148,7 +149,7 @@ def get_msg_timeout(options):
66332a
 
66332a
     (return_code, out, err) = run_command(options, cmd)
66332a
 
66332a
-    for line in out.split("\n"):
66332a
+    for line in itertools.chain(out.split("\n"), err.split("\n")):
66332a
         if len(line) == 0:
66332a
             continue
66332a