diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-04-02 18:37:33 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-04-02 18:37:33 +0100 |
commit | f8e72bc79a430214203cd7e8eb2222ebdce0cea7 (patch) | |
tree | 19cbd8315b1953ef7188685ea602ec4319fea772 | |
parent | 36efd32ab01df2c076c3271543d674a515094375 (diff) | |
download | sos-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.py | 30 |
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 |