Blame SOURCES/sos-bz916705-fix-rhel_version-problems.patch

6b17e9
commit c8fb8ff10de13b9f39044e2196976b15343a4d8e
6b17e9
Author: Bryn M. Reeves <bmr@redhat.com>
6b17e9
Date:   Wed Aug 14 18:22:28 2013 +0100
6b17e9
6b17e9
    Remove obsolete checks and exception handling from s390 plug-in
6b17e9
    
6b17e9
    The s390 plug-in has some strange checks on the distribution
6b17e9
    version before collecting a couple of s390-specific commands. The
6b17e9
    entire code block is also wrapped in try/except.
6b17e9
    
6b17e9
    Remove this: all add_cmd_output() succeed without exceptions even
6b17e9
    if the command does not exist or cannot be run. The exception
6b17e9
    handling also does nothing useful.
6b17e9
    
6b17e9
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
6b17e9
6b17e9
diff --git a/sos/plugins/s390.py b/sos/plugins/s390.py
6b17e9
index 7254649..ed9546b 100644
6b17e9
--- a/sos/plugins/s390.py
6b17e9
+++ b/sos/plugins/s390.py
6b17e9
@@ -58,14 +58,10 @@ class S390(Plugin, RedHatPlugin):
6b17e9
         self.add_cmd_output("find /sys -type f")
6b17e9
         self.add_cmd_output("find /proc/s390dbf -type f")
6b17e9
         self.add_cmd_output("qethconf list_all")
6b17e9
+        self.add_cmd_output("lsqeth")
6b17e9
+        self.add_cmd_output("lszfcp")
6b17e9
         ret, dasd_dev, rtime = self.call_ext_prog("ls /dev/dasd?")
6b17e9
         for x in dasd_dev.split('\n'):
6b17e9
             self.add_cmd_output("dasdview -x -i -j -l -f %s" % (x,))
6b17e9
             self.add_cmd_output("fdasd -p %s" % (x,))
6b17e9
-        try:
6b17e9
-            rhelver = self.policy().rhel_version()
6b17e9
-            if rhelver == 5:
6b17e9
-                self.add_cmd_output("lsqeth")
6b17e9
-                self.add_cmd_output("lszfcp")
6b17e9
-        except:
6b17e9
-            rhelver = None
6b17e9
+
6b17e9
commit 27ce4dcc524c0af2ed8c2e8449ed9783e35c174e
6b17e9
Author: Bryn M. Reeves <bmr@redhat.com>
6b17e9
Date:   Wed Aug 14 18:26:08 2013 +0100
6b17e9
6b17e9
    Remove legacy system support from cluster plug-in
6b17e9
    
6b17e9
    The cluster plug-in attempted to support three prior generations
6b17e9
    of cluster components in a single plug-in. These will never be
6b17e9
    required today since all current versions where sos-3.x would be
6b17e9
    used are all using much later packages.
6b17e9
    
6b17e9
    Remove this code and simplify the overall plug-in organisation.
6b17e9
    
6b17e9
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
6b17e9
6b17e9
diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py
6b17e9
index 8a3432e..0ed3cb4 100644
6b17e9
--- a/sos/plugins/cluster.py
6b17e9
+++ b/sos/plugins/cluster.py
6b17e9
@@ -25,28 +25,19 @@ class Cluster(Plugin, RedHatPlugin):
6b17e9
                     'gather output of gfs lockdumps', 'slow', False),
6b17e9
                     ('lockdump', 'gather dlm lockdumps', 'slow', False)]
6b17e9
 
6b17e9
-    def check_enabled(self):
6b17e9
-        rhelver = self.policy().rhel_version()
6b17e9
-        if rhelver == 4:
6b17e9
-            self.packages = [ "ccs", "cman", "cman-kernel", "magma",
6b17e9
-                              "magma-plugins", "rgmanager", "fence", "dlm",
6b17e9
-                              "dlm-kernel", "gulm", "GFS", "GFS-kernel",
6b17e9
-                              "lvm2-cluster" ]
6b17e9
-        elif rhelver == 5:
6b17e9
-            self.packages = [ "rgmanager", "luci", "ricci",
6b17e9
-                              "system-config-cluster", "gfs-utils", "gnbd",
6b17e9
-                              "kmod-gfs", "kmod-gnbd", "lvm2-cluster",
6b17e9
-                              "gfs2-utils" ]
6b17e9
-
6b17e9
-        elif rhelver == 6:
6b17e9
-            self.packages = [ "ricci", "corosync", "openais",
6b17e9
-                              "cman", "clusterlib", "fence-agents" ]
6b17e9
-
6b17e9
-        self.files = [ "/etc/cluster/cluster.conf" ]
6b17e9
-        return Plugin.check_enabled(self)
6b17e9
+    packages = [
6b17e9
+        "ricci",
6b17e9
+        "corosync",
6b17e9
+        "openais",
6b17e9
+        "cman",
6b17e9
+        "clusterlib",
6b17e9
+        "fence-agents",
6b17e9
+        "pacemaker"
6b17e9
+    ]
6b17e9
+
6b17e9
+    files = [ "/etc/cluster/cluster.conf" ]
6b17e9
 
6b17e9
     def setup(self):
6b17e9
-        rhelver = self.policy().rhel_version()
6b17e9
 
6b17e9
         self.add_copy_spec("/etc/cluster.conf")
6b17e9
         self.add_copy_spec("/etc/cluster.xml")
6b17e9
@@ -61,13 +52,13 @@ class Cluster(Plugin, RedHatPlugin):
6b17e9
         self.add_copy_spec("/etc/fence_virt.conf")
6b17e9
 
6b17e9
         if self.get_option('gfslockdump'):
6b17e9
-          self.do_gfslockdump()
6b17e9
+            self.do_gfslockdump()
6b17e9
 
6b17e9
         if self.get_option('lockdump'):
6b17e9
-          self.do_lockdump()
6b17e9
+            self.do_lockdump()
6b17e9
 
6b17e9
         self.add_cmd_output("rg_test test "
6b17e9
-                        + "/etc/cluster/cluster.conf" )
6b17e9
+                            + "/etc/cluster/cluster.conf" )
6b17e9
         self.add_cmd_output("fence_tool ls -n")
6b17e9
         self.add_cmd_output("gfs_control ls -n")
6b17e9
         self.add_cmd_output("dlm_tool log_plock")
6b17e9
@@ -80,56 +71,23 @@ class Cluster(Plugin, RedHatPlugin):
6b17e9
         self.add_cmd_output("ccs_tool lsnode")
6b17e9
         self.add_cmd_output("ipvsadm -L")
6b17e9
 
6b17e9
-        if rhelver is 4:
6b17e9
-            self.add_copy_spec("/proc/cluster/*")
6b17e9
-            self.add_cmd_output("cman_tool nodes")
6b17e9
-
6b17e9
-        if rhelver is not 4: # 5+
6b17e9
-            self.add_cmd_output("cman_tool -a nodes")
6b17e9
-
6b17e9
-        if rhelver is 5:
6b17e9
-            self.add_cmd_output("group_tool -v")
6b17e9
-            self.add_cmd_output("group_tool dump fence")
6b17e9
-            self.add_cmd_output("group_tool dump gfs")
6b17e9
-
6b17e9
-        if rhelver not in (4,5): # 6+
6b17e9
-            self.add_cmd_output("corosync-quorumtool -l")
6b17e9
-            self.add_cmd_output("corosync-quorumtool -s")
6b17e9
-            self.add_cmd_output("corosync-cpgtool")
6b17e9
-            self.add_cmd_output("corosync-objctl")
6b17e9
-            self.add_cmd_output("group_tool ls -g1")
6b17e9
-            self.add_cmd_output("gfs_control ls -n")
6b17e9
-            self.add_cmd_output("gfs_control dump")
6b17e9
-            self.add_cmd_output("fence_tool dump")
6b17e9
-            self.add_cmd_output("dlm_tool dump")
6b17e9
-            self.add_cmd_output("dlm_tool ls -n")
6b17e9
-            self.add_cmd_output("mkqdisk -L")
6b17e9
+        self.add_cmd_output("corosync-quorumtool -l")
6b17e9
+        self.add_cmd_output("corosync-quorumtool -s")
6b17e9
+        self.add_cmd_output("corosync-cpgtool")
6b17e9
+        self.add_cmd_output("corosync-objctl")
6b17e9
+        self.add_cmd_output("group_tool ls -g1")
6b17e9
+        self.add_cmd_output("gfs_control ls -n")
6b17e9
+        self.add_cmd_output("gfs_control dump")
6b17e9
+        self.add_cmd_output("fence_tool dump")
6b17e9
+        self.add_cmd_output("dlm_tool dump")
6b17e9
+        self.add_cmd_output("dlm_tool ls -n")
6b17e9
+        self.add_cmd_output("mkqdisk -L")
6b17e9
 
6b17e9
     def do_lockdump(self):
6b17e9
-        rhelver = self.policy().rhel_version()
6b17e9
-
6b17e9
-        if rhelver is 4:
6b17e9
-            status, output, time = self.call_ext_prog("cman_tool services")
6b17e9
-            for lockspace in re.compile(r'^DLM Lock Space:\s*"([^"]*)".*$',
6b17e9
-                    re.MULTILINE).findall(output):
6b17e9
-                self.call_ext_prog("echo %s > /proc/cluster/dlm_locks" 
6b17e9
-                        % lockspace)
6b17e9
-                self.get_cmd_output_now("cat /proc/cluster/dlm_locks",
6b17e9
-                        suggest_filename = "dlm_locks_%s" % lockspace)
6b17e9
-
6b17e9
-        if rhelver is 5:
6b17e9
-            status, output, time = self.call_ext_prog("group_tool")
6b17e9
-            for lockspace in re.compile(r'^dlm\s+[^\s]+\s+([^\s]+)$',
6b17e9
-                    re.MULTILINE).findall(output):
6b17e9
-                self.add_cmd_output("dlm_tool lockdebug '%s'" % lockspace,
6b17e9
-                        suggest_filename = "dlm_locks_%s" % lockspace)
6b17e9
-
6b17e9
-        else: # RHEL6 or recent Fedora
6b17e9
-            status, output, time = self.call_ext_prog("dlm_tool ls")
6b17e9
-            for lockspace in re.compile(r'^name\s+([^\s]+)$',
6b17e9
-                    re.MULTILINE).findall(output):
6b17e9
-                self.add_cmd_output("dlm_tool lockdebug -svw '%s'"
6b17e9
-                        % lockspace,
6b17e9
+        status, output, time = self.call_ext_prog("dlm_tool ls")
6b17e9
+        for lockspace in re.compile(r'^name\s+([^\s]+)$',
6b17e9
+                re.MULTILINE).findall(output):
6b17e9
+            self.add_cmd_output("dlm_tool lockdebug -svw '%s'" % lockspace,
6b17e9
                         suggest_filename = "dlm_locks_%s" % lockspace)
6b17e9
 
6b17e9
     def do_gfslockdump(self):