From f8e72bc79a430214203cd7e8eb2222ebdce0cea7 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 2 Apr 2014 18:37:33 +0100 Subject: 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 --- sos/plugins/cgroups.py | 30 ++++++++++++++++-------------- 1 file 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 -- cgit