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