Blob Blame History Raw
commit c8fb8ff10de13b9f39044e2196976b15343a4d8e
Author: Bryn M. Reeves <bmr@redhat.com>
Date:   Wed Aug 14 18:22:28 2013 +0100

    Remove obsolete checks and exception handling from s390 plug-in
    
    The s390 plug-in has some strange checks on the distribution
    version before collecting a couple of s390-specific commands. The
    entire code block is also wrapped in try/except.
    
    Remove this: all add_cmd_output() succeed without exceptions even
    if the command does not exist or cannot be run. The exception
    handling also does nothing useful.
    
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>

diff --git a/sos/plugins/s390.py b/sos/plugins/s390.py
index 7254649..ed9546b 100644
--- a/sos/plugins/s390.py
+++ b/sos/plugins/s390.py
@@ -58,14 +58,10 @@ class S390(Plugin, RedHatPlugin):
         self.add_cmd_output("find /sys -type f")
         self.add_cmd_output("find /proc/s390dbf -type f")
         self.add_cmd_output("qethconf list_all")
+        self.add_cmd_output("lsqeth")
+        self.add_cmd_output("lszfcp")
         ret, dasd_dev, rtime = self.call_ext_prog("ls /dev/dasd?")
         for x in dasd_dev.split('\n'):
             self.add_cmd_output("dasdview -x -i -j -l -f %s" % (x,))
             self.add_cmd_output("fdasd -p %s" % (x,))
-        try:
-            rhelver = self.policy().rhel_version()
-            if rhelver == 5:
-                self.add_cmd_output("lsqeth")
-                self.add_cmd_output("lszfcp")
-        except:
-            rhelver = None
+
commit 27ce4dcc524c0af2ed8c2e8449ed9783e35c174e
Author: Bryn M. Reeves <bmr@redhat.com>
Date:   Wed Aug 14 18:26:08 2013 +0100

    Remove legacy system support from cluster plug-in
    
    The cluster plug-in attempted to support three prior generations
    of cluster components in a single plug-in. These will never be
    required today since all current versions where sos-3.x would be
    used are all using much later packages.
    
    Remove this code and simplify the overall plug-in organisation.
    
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>

diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py
index 8a3432e..0ed3cb4 100644
--- a/sos/plugins/cluster.py
+++ b/sos/plugins/cluster.py
@@ -25,28 +25,19 @@ class Cluster(Plugin, RedHatPlugin):
                     'gather output of gfs lockdumps', 'slow', False),
                     ('lockdump', 'gather dlm lockdumps', 'slow', False)]
 
-    def check_enabled(self):
-        rhelver = self.policy().rhel_version()
-        if rhelver == 4:
-            self.packages = [ "ccs", "cman", "cman-kernel", "magma",
-                              "magma-plugins", "rgmanager", "fence", "dlm",
-                              "dlm-kernel", "gulm", "GFS", "GFS-kernel",
-                              "lvm2-cluster" ]
-        elif rhelver == 5:
-            self.packages = [ "rgmanager", "luci", "ricci",
-                              "system-config-cluster", "gfs-utils", "gnbd",
-                              "kmod-gfs", "kmod-gnbd", "lvm2-cluster",
-                              "gfs2-utils" ]
-
-        elif rhelver == 6:
-            self.packages = [ "ricci", "corosync", "openais",
-                              "cman", "clusterlib", "fence-agents" ]
-
-        self.files = [ "/etc/cluster/cluster.conf" ]
-        return Plugin.check_enabled(self)
+    packages = [
+        "ricci",
+        "corosync",
+        "openais",
+        "cman",
+        "clusterlib",
+        "fence-agents",
+        "pacemaker"
+    ]
+
+    files = [ "/etc/cluster/cluster.conf" ]
 
     def setup(self):
-        rhelver = self.policy().rhel_version()
 
         self.add_copy_spec("/etc/cluster.conf")
         self.add_copy_spec("/etc/cluster.xml")
@@ -61,13 +52,13 @@ class Cluster(Plugin, RedHatPlugin):
         self.add_copy_spec("/etc/fence_virt.conf")
 
         if self.get_option('gfslockdump'):
-          self.do_gfslockdump()
+            self.do_gfslockdump()
 
         if self.get_option('lockdump'):
-          self.do_lockdump()
+            self.do_lockdump()
 
         self.add_cmd_output("rg_test test "
-                        + "/etc/cluster/cluster.conf" )
+                            + "/etc/cluster/cluster.conf" )
         self.add_cmd_output("fence_tool ls -n")
         self.add_cmd_output("gfs_control ls -n")
         self.add_cmd_output("dlm_tool log_plock")
@@ -80,56 +71,23 @@ class Cluster(Plugin, RedHatPlugin):
         self.add_cmd_output("ccs_tool lsnode")
         self.add_cmd_output("ipvsadm -L")
 
-        if rhelver is 4:
-            self.add_copy_spec("/proc/cluster/*")
-            self.add_cmd_output("cman_tool nodes")
-
-        if rhelver is not 4: # 5+
-            self.add_cmd_output("cman_tool -a nodes")
-
-        if rhelver is 5:
-            self.add_cmd_output("group_tool -v")
-            self.add_cmd_output("group_tool dump fence")
-            self.add_cmd_output("group_tool dump gfs")
-
-        if rhelver not in (4,5): # 6+
-            self.add_cmd_output("corosync-quorumtool -l")
-            self.add_cmd_output("corosync-quorumtool -s")
-            self.add_cmd_output("corosync-cpgtool")
-            self.add_cmd_output("corosync-objctl")
-            self.add_cmd_output("group_tool ls -g1")
-            self.add_cmd_output("gfs_control ls -n")
-            self.add_cmd_output("gfs_control dump")
-            self.add_cmd_output("fence_tool dump")
-            self.add_cmd_output("dlm_tool dump")
-            self.add_cmd_output("dlm_tool ls -n")
-            self.add_cmd_output("mkqdisk -L")
+        self.add_cmd_output("corosync-quorumtool -l")
+        self.add_cmd_output("corosync-quorumtool -s")
+        self.add_cmd_output("corosync-cpgtool")
+        self.add_cmd_output("corosync-objctl")
+        self.add_cmd_output("group_tool ls -g1")
+        self.add_cmd_output("gfs_control ls -n")
+        self.add_cmd_output("gfs_control dump")
+        self.add_cmd_output("fence_tool dump")
+        self.add_cmd_output("dlm_tool dump")
+        self.add_cmd_output("dlm_tool ls -n")
+        self.add_cmd_output("mkqdisk -L")
 
     def do_lockdump(self):
-        rhelver = self.policy().rhel_version()
-
-        if rhelver is 4:
-            status, output, time = self.call_ext_prog("cman_tool services")
-            for lockspace in re.compile(r'^DLM Lock Space:\s*"([^"]*)".*$',
-                    re.MULTILINE).findall(output):
-                self.call_ext_prog("echo %s > /proc/cluster/dlm_locks" 
-                        % lockspace)
-                self.get_cmd_output_now("cat /proc/cluster/dlm_locks",
-                        suggest_filename = "dlm_locks_%s" % lockspace)
-
-        if rhelver is 5:
-            status, output, time = self.call_ext_prog("group_tool")
-            for lockspace in re.compile(r'^dlm\s+[^\s]+\s+([^\s]+)$',
-                    re.MULTILINE).findall(output):
-                self.add_cmd_output("dlm_tool lockdebug '%s'" % lockspace,
-                        suggest_filename = "dlm_locks_%s" % lockspace)
-
-        else: # RHEL6 or recent Fedora
-            status, output, time = self.call_ext_prog("dlm_tool ls")
-            for lockspace in re.compile(r'^name\s+([^\s]+)$',
-                    re.MULTILINE).findall(output):
-                self.add_cmd_output("dlm_tool lockdebug -svw '%s'"
-                        % lockspace,
+        status, output, time = self.call_ext_prog("dlm_tool ls")
+        for lockspace in re.compile(r'^name\s+([^\s]+)$',
+                re.MULTILINE).findall(output):
+            self.add_cmd_output("dlm_tool lockdebug -svw '%s'" % lockspace,
                         suggest_filename = "dlm_locks_%s" % lockspace)
 
     def do_gfslockdump(self):