Blame SOURCES/sos-bz1148375-add-support-for-tomcat7.patch

e75bc7
From 874cc7d0889adf32b8c36bb218212d3304d43d5b Mon Sep 17 00:00:00 2001
e75bc7
From: "Bryn M. Reeves" <bmr@redhat.com>
e75bc7
Date: Mon, 20 Oct 2014 09:13:07 +0100
e75bc7
Subject: [PATCH] [tomcat] add support for tomcat7 and log size limits
e75bc7
e75bc7
Based on a patch from Pavel Moravec in Issue #412.
e75bc7
e75bc7
Fixes #412.
e75bc7
e75bc7
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
e75bc7
---
e75bc7
 sos/plugins/tomcat.py | 14 +++++++++-----
e75bc7
 1 file changed, 9 insertions(+), 5 deletions(-)
e75bc7
e75bc7
diff --git a/sos/plugins/tomcat.py b/sos/plugins/tomcat.py
e75bc7
index b7aea2c..4f78c1d 100644
e75bc7
--- a/sos/plugins/tomcat.py
e75bc7
+++ b/sos/plugins/tomcat.py
e75bc7
@@ -22,17 +22,21 @@ class Tomcat(Plugin, RedHatPlugin):
e75bc7
     plugin_name = 'tomcat'
e75bc7
     profiles = ('webserver', 'java', 'services')
e75bc7
 
e75bc7
-    packages = ('tomcat6',)
e75bc7
+    packages = ('tomcat6', 'tomcat')
e75bc7
 
e75bc7
     def setup(self):
e75bc7
         self.add_copy_spec([
e75bc7
-            "/etc/tomcat6",
e75bc7
-            "/var/log/tomcat6/catalina.out"
e75bc7
+            "/etc/tomcat",
e75bc7
+            "/etc/tomcat6"
e75bc7
         ])
e75bc7
 
e75bc7
+        limit = self.get_option("log_size")
e75bc7
+        log_glob = "/var/log/tomcat*/catalina.out"
e75bc7
+        self.add_copy_spec_limit(log_glob, sizelimit=limit)
e75bc7
+
e75bc7
     def postproc(self):
e75bc7
-        self.do_file_sub(
e75bc7
-            "/etc/tomcat6/tomcat-users.xml",
e75bc7
+        self.do_path_regex_sub(
e75bc7
+            r"\/etc\/tomcat.*\/tomcat-users.xml",
e75bc7
             r"password=(\S*)",
e75bc7
             r'password="********"'
e75bc7
         )
e75bc7
-- 
e75bc7
1.9.3
e75bc7