Blame SOURCES/sos-bz1613806-rhosp-lsof-optional.patch

b72d26
From a55680e6c8ac87fdf4ee3100717001c1f6f6a08b Mon Sep 17 00:00:00 2001
b72d26
From: Pavel Moravec <pmoravec@redhat.com>
b72d26
Date: Thu, 9 Aug 2018 08:59:53 +0200
b72d26
Subject: [PATCH 1/3] [process] make lsof execution optional
b72d26
b72d26
Make calling of lsof command optional (but enabled by default).
b72d26
b72d26
Also remove "collect lsof-threads when --all-logs" as all-logs
b72d26
has nothing in common.
b72d26
b72d26
Resolves: #1394
b72d26
b72d26
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
b72d26
---
b72d26
 sos/plugins/process.py | 6 ++++--
b72d26
 1 file changed, 4 insertions(+), 2 deletions(-)
b72d26
b72d26
diff --git a/sos/plugins/process.py b/sos/plugins/process.py
b72d26
index 755eec8d..d1c455a5 100644
b72d26
--- a/sos/plugins/process.py
b72d26
+++ b/sos/plugins/process.py
b72d26
@@ -17,6 +17,7 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
b72d26
     profiles = ('system',)
b72d26
 
b72d26
     option_list = [
b72d26
+        ("lsof", "gathers information on all open files", "slow", True),
b72d26
         ("lsof-threads", "gathers threads' open file info if supported",
b72d26
          "slow", False)
b72d26
     ]
b72d26
@@ -35,9 +36,10 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
b72d26
 
b72d26
         self.add_cmd_output("ps auxwww", root_symlink="ps")
b72d26
         self.add_cmd_output("pstree", root_symlink="pstree")
b72d26
-        self.add_cmd_output("lsof -b +M -n -l -c ''", root_symlink="lsof")
b72d26
+        if self.get_option("lsof"):
b72d26
+            self.add_cmd_output("lsof -b +M -n -l -c ''", root_symlink="lsof")
b72d26
 
b72d26
-        if self.get_option("lsof-threads") or self.get_option("all_logs"):
b72d26
+        if self.get_option("lsof-threads"):
b72d26
             self.add_cmd_output("lsof -b +M -n -l")
b72d26
 
b72d26
         self.add_cmd_output([
b72d26
-- 
b72d26
2.17.1
b72d26
b72d26
From 48a1a00685c680ba9fbd5c9b10377e8d0551a926 Mon Sep 17 00:00:00 2001
b72d26
From: Pavel Moravec <pmoravec@redhat.com>
b72d26
Date: Thu, 9 Aug 2018 18:11:38 +0200
b72d26
Subject: [PATCH 2/3] [policies] RHOSP preset with -k process.lsof=off
b72d26
b72d26
Make lsof calls on OSP systems disabled by default.
b72d26
b72d26
Relevant to: #1395
b72d26
b72d26
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
b72d26
---
b72d26
 sos/policies/redhat.py | 4 +++-
b72d26
 1 file changed, 3 insertions(+), 1 deletion(-)
b72d26
b72d26
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
b72d26
index cfbf7808..ee687d46 100644
b72d26
--- a/sos/policies/redhat.py
b72d26
+++ b/sos/policies/redhat.py
b72d26
@@ -192,6 +192,8 @@ ENV_HOST_SYSROOT = 'HOST'
b72d26
 _opts_verify = SoSOptions(verify=True)
b72d26
 _opts_all_logs = SoSOptions(all_logs=True)
b72d26
 _opts_all_logs_verify = SoSOptions(all_logs=True, verify=True)
b72d26
+_opts_all_logs_no_lsof = SoSOptions(all_logs=True,
b72d26
+                                    plugopts=['process.lsof=off'])
b72d26
 
b72d26
 RHEL_RELEASE_STR = "Red Hat Enterprise Linux"
b72d26
 
b72d26
@@ -219,7 +221,7 @@ rhel_presets = {
b72d26
                         opts=_opts_verify),
b72d26
     RHEL: PresetDefaults(name=RHEL, desc=RHEL_DESC),
b72d26
     RHOSP: PresetDefaults(name=RHOSP, desc=RHOSP_DESC, note=NOTE_SIZE,
b72d26
-                          opts=_opts_all_logs),
b72d26
+                          opts=_opts_all_logs_no_lsof),
b72d26
     RHOCP: PresetDefaults(name=RHOCP, desc=RHOCP_DESC, note=NOTE_SIZE_TIME,
b72d26
                           opts=_opts_all_logs_verify),
b72d26
     RH_SATELLITE: PresetDefaults(name=RH_SATELLITE, desc=RH_SATELLITE_DESC,
b72d26
-- 
b72d26
2.17.1
b72d26
b72d26
From 84c30742254a536f70bb4217756416bcf0e8a51b Mon Sep 17 00:00:00 2001
b72d26
From: Pavel Moravec <pmoravec@redhat.com>
b72d26
Date: Thu, 9 Aug 2018 18:14:56 +0200
b72d26
Subject: [PATCH 3/3] [policies] enable RHOSP preset by presence of
b72d26
 rhosp-release package
b72d26
b72d26
Resolves: #1395
b72d26
b72d26
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
b72d26
---
b72d26
 sos/policies/redhat.py | 2 ++
b72d26
 1 file changed, 2 insertions(+)
b72d26
b72d26
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
b72d26
index ee687d46..5bfbade2 100644
b72d26
--- a/sos/policies/redhat.py
b72d26
+++ b/sos/policies/redhat.py
b72d26
@@ -315,6 +315,8 @@ No changes will be made to system configuration.
b72d26
         # Package based checks
b72d26
         if self.pkg_by_name("satellite-common") is not None:
b72d26
             return self.find_preset(RH_SATELLITE)
b72d26
+        if self.pkg_by_name("rhosp-release") is not None:
b72d26
+            return self.find_preset(RHOSP)
b72d26
 
b72d26
         # Vanilla RHEL is default
b72d26
         return self.find_preset(RHEL)
b72d26
-- 
b72d26
2.17.1
b72d26