File 0004-Fix-hb_report-analysis.txt-should-includes-warning-e.patch of Package crmsh.12571

From 6af492463463e8605b6588c05cc9444cf0fec665 Mon Sep 17 00:00:00 2001
From: liangxin1300 <XLiang@suse.com>
Date: Tue, 21 May 2019 13:15:38 +0800
Subject: [PATCH 4/4] Fix: hb_report: analysis.txt should includes warning,
 error, critical messages(bsc#1135696)

---
 hb_report/constants.py | 2 +-
 hb_report/utillib.py   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hb_report/constants.py b/hb_report/constants.py
index 8afefb42..c2d3925f 100644
--- a/hb_report/constants.py
+++ b/hb_report/constants.py
@@ -29,7 +29,7 @@ HA_LOGLEVEL = "info"
 HA_BIN = None
 HA_VARLIB = None
 LOCAL_SUDO = ""
-LOG_PATTERNS = "CRIT: ERROR:"
+LOG_PATTERNS = "CRIT: ERROR: error: warning: crit:"
 NO_DESCRIPTION = 1
 NO_SSH = config.report.single_node
 NODES = ""
diff --git a/hb_report/utillib.py b/hb_report/utillib.py
index 5467fd00..69383717 100644
--- a/hb_report/utillib.py
+++ b/hb_report/utillib.py
@@ -195,11 +195,11 @@ def check_logs(workdir):
     out_string = ""
     log_list = []
     for l in constants.EXTRA_LOGS.split():
-        log_list += find_files_all(workdir, os.path.basename(l))
+        log_list += find_files_all(os.path.basename(l), workdir)
     if not log_list:
         return out_string
 
-    out_string += "Log patterns:\n"
+    out_string += "\nLog patterns:\n"
     log_patterns = constants.LOG_PATTERNS.replace(' ', '|')
     for n in constants.NODES.split():
         for f in log_list:
-- 
2.22.1

openSUSE Build Service is sponsored by