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

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