aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-04-02 18:37:33 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-04-02 18:37:33 +0100
commitf8e72bc79a430214203cd7e8eb2222ebdce0cea7 (patch)
tree19cbd8315b1953ef7188685ea602ec4319fea772
parent36efd32ab01df2c076c3271543d674a515094375 (diff)
downloadsos-f8e72bc79a430214203cd7e8eb2222ebdce0cea7.tar.gz
Refactor cgroups plugin
Move common files from DebianCgroups to Cgroups and drop separate DebianPlugin class. Make add_copy_specs() invocations conform to recommended indent style. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/cgroups.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/sos/plugins/cgroups.py b/sos/plugins/cgroups.py
index 6f34e649..a647a9f6 100644
--- a/sos/plugins/cgroups.py
+++ b/sos/plugins/cgroups.py
@@ -14,19 +14,19 @@
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class Cgroups(Plugin):
+class Cgroups(Plugin, DebianPlugin, UbuntuPlugin):
"""cgroup subsystem information
"""
- plugin_name = "cgroups"
-
-class DebianCgroups(Cgroups, DebianPlugin, UbuntuPlugin):
-
files = ('/proc/cgroups',)
+ plugin_name = "cgroups"
+
def setup(self):
- self.add_copy_specs(["/proc/cgroups",
- "/sys/fs/cgroup"])
+ self.add_copy_specs([
+ "/proc/cgroups",
+ "/sys/fs/cgroup"
+ ])
return
class RedHatCgroups(Cgroups, RedHatPlugin):
@@ -34,11 +34,13 @@ class RedHatCgroups(Cgroups, RedHatPlugin):
"""
def setup(self):
- self.add_copy_specs(["/etc/sysconfig/cgconfig",
- "/etc/sysconfig/cgred.conf",
- "/etc/cgsnapshot_blacklist.conf",
- "/etc/cgconfig.conf",
- "/etc/cgrules.conf"])
-
-
+ super(RedHatCgroups, self).setup()
+ self.add_copy_specs([
+ "/etc/sysconfig/cgconfig",
+ "/etc/sysconfig/cgred.conf",
+ "/etc/cgsnapshot_blacklist.conf",
+ "/etc/cgconfig.conf",
+ "/etc/cgrules.conf"
+ ])
+
# vim: et ts=4 sw=4