From 1ed68845a80a69d855b949a0f787eee60316fd0a Mon Sep 17 00:00:00 2001 From: Adam Stokes Date: Sat, 2 Aug 2014 01:16:43 -0400 Subject: [plugins] pep8 compliance for rest of plugins All plugins should now be in compliance with pep8 Signed-off-by: Adam Stokes --- sos/plugins/abrt.py | 2 -- sos/plugins/java.py | 2 +- sos/plugins/lvm2.py | 2 -- sos/plugins/md.py | 2 +- sos/plugins/multipath.py | 1 - sos/plugins/openstack_cinder.py | 3 +- sos/plugins/openstack_glance.py | 35 +++++++++++----------- sos/plugins/openstack_heat.py | 24 +++++++-------- sos/plugins/openstack_horizon.py | 37 +++++++++++------------ sos/plugins/openstack_keystone.py | 46 ++++++++++++++-------------- sos/plugins/openstack_neutron.py | 63 ++++++++++++++++++++------------------- sos/plugins/openstack_nova.py | 35 +++++++++++----------- sos/plugins/openstack_swift.py | 38 ++++++++++++----------- sos/plugins/openswan.py | 29 +++++++++--------- sos/plugins/ovirt.py | 36 +++++++++++----------- sos/plugins/pam.py | 24 ++++++++------- sos/plugins/pci.py | 29 ++++++++---------- sos/plugins/pcp.py | 3 +- sos/plugins/postfix.py | 26 ++++++++-------- sos/plugins/postgresql.py | 33 ++++++++++---------- sos/plugins/powerpc.py | 27 +++++++++-------- sos/plugins/ppp.py | 25 ++++++++-------- sos/plugins/procenv.py | 25 ++++++++-------- sos/plugins/process.py | 30 +++++++++---------- sos/plugins/processor.py | 27 ++++++++--------- sos/plugins/psacct.py | 32 ++++++++++---------- sos/plugins/pxe.py | 26 ++++++++-------- sos/plugins/qpid.py | 45 ++++++++++++++-------------- sos/plugins/quagga.py | 25 ++++++++-------- sos/plugins/rabbitmq.py | 22 +++++++------- sos/plugins/radius.py | 30 +++++++++++-------- sos/plugins/rhui.py | 35 +++++++++++----------- sos/plugins/rpm.py | 42 +++++++++++++++----------- sos/plugins/s390.py | 29 +++++++++--------- sos/plugins/samba.py | 23 +++++++------- sos/plugins/sanlock.py | 28 +++++++++-------- sos/plugins/sar.py | 30 ++++++++++--------- sos/plugins/satellite.py | 41 ++++++++++++------------- sos/plugins/scsi.py | 27 ++++++++--------- sos/plugins/selinux.py | 27 +++++++++-------- sos/plugins/sendmail.py | 29 +++++++++--------- sos/plugins/smartcard.py | 25 ++++++++-------- sos/plugins/snmp.py | 28 +++++++++-------- sos/plugins/soundcard.py | 26 ++++++++-------- sos/plugins/squid.py | 26 ++++++++-------- sos/plugins/ssh.py | 25 ++++++++-------- sos/plugins/sssd.py | 31 ++++++++++--------- sos/plugins/startup.py | 34 ++++++++++++--------- sos/plugins/sunrpc.py | 32 ++++++++++---------- sos/plugins/system.py | 27 +++++++++-------- sos/plugins/systemd.py | 25 ++++++++-------- sos/plugins/systemtap.py | 25 ++++++++-------- sos/plugins/sysvipc.py | 25 ++++++++-------- sos/plugins/tftpserver.py | 25 ++++++++-------- sos/plugins/tomcat.py | 23 +++++++------- sos/plugins/tuned.py | 25 ++++++++-------- sos/plugins/udev.py | 23 +++++++------- sos/plugins/upstart.py | 24 +++++++-------- sos/plugins/usb.py | 27 ++++++++--------- sos/plugins/veritas.py | 31 +++++++++---------- sos/plugins/vmware.py | 25 ++++++++-------- sos/plugins/vsftpd.py | 23 +++++++------- sos/plugins/x11.py | 23 +++++++------- sos/plugins/xen.py | 30 ++++++++++--------- sos/plugins/xfs.py | 25 ++++++++-------- sos/plugins/xinetd.py | 25 ++++++++-------- sos/plugins/yum.py | 36 ++++++++++++---------- 67 files changed, 925 insertions(+), 864 deletions(-) diff --git a/sos/plugins/abrt.py b/sos/plugins/abrt.py index 56ed0d46..d701dbde 100644 --- a/sos/plugins/abrt.py +++ b/sos/plugins/abrt.py @@ -45,6 +45,4 @@ class Abrt(Plugin, RedHatPlugin): if self.get_option('backtraces'): self.do_backtraces() - - # vim: et ts=4 sw=4 diff --git a/sos/plugins/java.py b/sos/plugins/java.py index 9fa69b80..d50b4e77 100644 --- a/sos/plugins/java.py +++ b/sos/plugins/java.py @@ -1,4 +1,4 @@ -## This program is free software; you can redistribute it and/or modify +# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. diff --git a/sos/plugins/lvm2.py b/sos/plugins/lvm2.py index 0b1fccbe..60f4bbc7 100644 --- a/sos/plugins/lvm2.py +++ b/sos/plugins/lvm2.py @@ -67,6 +67,4 @@ class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): elif self.get_option('lvmdump-am'): self.do_lvmdump(metadata=True) - - # vim: et ts=4 sw=4 diff --git a/sos/plugins/md.py b/sos/plugins/md.py index 5ca3ab0c..9e2a50be 100644 --- a/sos/plugins/md.py +++ b/sos/plugins/md.py @@ -1,4 +1,4 @@ -## This program is free software; you can redistribute it and/or modify +# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. diff --git a/sos/plugins/multipath.py b/sos/plugins/multipath.py index 8272ac1e..70d6597c 100644 --- a/sos/plugins/multipath.py +++ b/sos/plugins/multipath.py @@ -32,5 +32,4 @@ class Multipath(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): ]) - # vim: et ts=4 sw=4 diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py index 43b20061..5cf8c92e 100644 --- a/sos/plugins/openstack_cinder.py +++ b/sos/plugins/openstack_cinder.py @@ -1,5 +1,6 @@ # Copyright (C) 2009 Red Hat, Inc., Joey Boggs -# Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd +# Copyright (C) 2012 Rackspace US, Inc., +# Justin Shepherd # Copyright (C) 2013 Red Hat, Inc., Flavio Percoco # Copyright (C) 2013 Red Hat, Inc., Jeremy Agee diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py index a8c25d93..e02cbc57 100644 --- a/sos/plugins/openstack_glance.py +++ b/sos/plugins/openstack_glance.py @@ -1,20 +1,21 @@ -## Copyright (C) 2013 Red Hat, Inc., Flavio Percoco -## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd -## Copyright (C) 2009 Red Hat, Inc., Joey Boggs - -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. - -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco +# Copyright (C) 2012 Rackspace US, Inc., +# Justin Shepherd +# Copyright (C) 2009 Red Hat, Inc., Joey Boggs + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos import plugins diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py index 7b94bfcd..7b63cbbb 100644 --- a/sos/plugins/openstack_heat.py +++ b/sos/plugins/openstack_heat.py @@ -1,18 +1,18 @@ -## Copyright (C) 2013 Red Hat, Inc. +# Copyright (C) 2013 Red Hat, Inc. -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos import plugins diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py index 58bdc490..fa4a6723 100644 --- a/sos/plugins/openstack_horizon.py +++ b/sos/plugins/openstack_horizon.py @@ -1,22 +1,21 @@ -## Copyright (C) 2009 Red Hat, Inc., Joey Boggs -## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd -## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee - -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. - -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -import os +# Copyright (C) 2009 Red Hat, Inc., Joey Boggs +# Copyright (C) 2012 Rackspace US, Inc., +# Justin Shepherd +# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py index cc8ce265..a961fae6 100644 --- a/sos/plugins/openstack_keystone.py +++ b/sos/plugins/openstack_keystone.py @@ -1,20 +1,18 @@ -## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee +# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -import os +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin @@ -40,20 +38,20 @@ class OpenStackKeystone(Plugin): def postproc(self): self.do_file_sub('/etc/keystone/keystone.conf', - r"(?m)^(admin_password.*=)(.*)", - r"\1 ******") + r"(?m)^(admin_password.*=)(.*)", + r"\1 ******") self.do_file_sub('/etc/keystone/keystone.conf', - r"(?m)^(admin_token.*=)(.*)", - r"\1 ******") + r"(?m)^(admin_token.*=)(.*)", + r"\1 ******") self.do_file_sub('/etc/keystone/keystone.conf', - r"(?m)^(connection.*=.*mysql://)(.*)(:)(.*)(@)(.*)", - r"\1\2:******@\6") + r"(?m)^(connection.*=.*mysql://)(.*)(:)(.*)(@)(.*)", + r"\1\2:******@\6") self.do_file_sub('/etc/keystone/keystone.conf', - r"(?m)^(password.*=)(.*)", - r"\1 ******") + r"(?m)^(password.*=)(.*)", + r"\1 ******") self.do_file_sub('/etc/keystone/keystone.conf', - r"(?m)^(ca_password.*=)(.*)", - r"\1 ******") + r"(?m)^(ca_password.*=)(.*)", + r"\1 ******") class DebianOpenStackKeystone(OpenStackKeystone, DebianPlugin, UbuntuPlugin): diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py index 8928d9bd..606503eb 100644 --- a/sos/plugins/openstack_neutron.py +++ b/sos/plugins/openstack_neutron.py @@ -1,18 +1,18 @@ -## Copyright (C) 2013 Red Hat, Inc., Brent Eagles +# Copyright (C) 2013 Red Hat, Inc., Brent Eagles -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import os import re @@ -26,6 +26,7 @@ from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin # has the interface names for an instance. So what remains is relevant database # info... + class Neutron(Plugin): """OpenStack Networking (quantum/neutron) related information """ @@ -38,7 +39,8 @@ class Neutron(Plugin): component_name = "neutron" def setup(self): - if os.path.exists("/etc/neutron/") and self.get_option("quantum", False): + if os.path.exists("/etc/neutron/") and \ + self.get_option("quantum", False): self.component_name = self.plugin_name else: self.component_name = "quantum" @@ -51,11 +53,11 @@ class Neutron(Plugin): self.netns_dumps() self.get_ovs_dumps() - def get_ovs_dumps(self): - # Check to see if we are using the Open vSwitch plugin. If not we + # Check to see if we are using the Open vSwitch plugin. If not we # should be able to skip the rest of the dump. - ovs_conf_check = self.call_ext_prog('grep "^core_plugin.*openvswitch" ' + + ovs_conf_check = self.call_ext_prog( + 'grep "^core_plugin.*openvswitch" ' + ("/etc/%s/*.conf" + self.component_name)) if not (ovs_conf_check['status'] == 0): return @@ -86,23 +88,24 @@ class Neutron(Plugin): prefix, netid = nsname.split('-', 1) if len(netid) > 0 and prefix in prefixes: self.ns_gather_data(nsname) - lease_directories.append("/var/lib/%s/dhcp/%s/" % + lease_directories.append( + "/var/lib/%s/dhcp/%s/" % (self.component_name, netid)) self.add_copy_specs(lease_directories) # TODO: Refactor! Copied from Networking plugin. - def get_interface_name(self,ip_addr_out): - """Return a dictionary for which key are interface name according to the - output of ifconifg-a stored in ifconfig_file. + def get_interface_name(self, ip_addr_out): + """Return a dictionary for which key are interface name according to + the output of ifconifg-a stored in ifconfig_file. """ - out={} + out = {} for line in ip_addr_out.splitlines(): - match=re.match('.*link/ether', line) + match = re.match('.*link/ether', line) if match: - int=match.string.split(':')[1].lstrip() - out[int]=True + int = match.string.split(':')[1].lstrip() + out[int] = True return out - + def ns_gather_data(self, nsname): cmd_prefix = "ip netns exec %s " % nsname self.add_cmd_outputs([ @@ -111,10 +114,10 @@ class Neutron(Plugin): cmd_prefix + "route -n" ]) # borrowed from networking plugin - ip_addr_result=self.call_ext_prog(cmd_prefix + "ip -o addr") + ip_addr_result = self.call_ext_prog(cmd_prefix + "ip -o addr") if ip_addr_result['status'] == 0: for eth in self.get_interface_name(ip_addr_result['output']): - # Most, if not all, IFs in the namespaces are going to be + # Most, if not all, IFs in the namespaces are going to be # virtual. The '-a', '-c' and '-g' options are not likely to be # supported so these ops are not copied from the network # plugin. @@ -131,9 +134,10 @@ class Neutron(Plugin): def gen_pkg_tuple(self, packages): names = [] for p in packages: - names.append(p % { "comp" : self.component_name }) + names.append(p % {"comp": self.component_name}) return tuple(names) + class DebianNeutron(Neutron, DebianPlugin, UbuntuPlugin): """OpenStack Neutron related information for Debian based distributions """ @@ -160,13 +164,12 @@ class DebianNeutron(Neutron, DebianPlugin, UbuntuPlugin): self.add_copy_spec("/etc/sudoers.d/%s_sudoers" % self.component_name) - class RedHatNeutron(Neutron, RedHatPlugin): """OpenStack Neutron related information for Red Hat distributions """ package_list_template = [ - 'openstack-%(comp)s', + 'openstack-%(comp)s', 'openstack-%(comp)s-linuxbridge' 'openstack-%(comp)s-metaplugin', 'openstack-%(comp)s-openvswitch', diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py index 104ad33b..a6c67416 100644 --- a/sos/plugins/openstack_nova.py +++ b/sos/plugins/openstack_nova.py @@ -1,20 +1,21 @@ -## Copyright (C) 2009 Red Hat, Inc., Joey Boggs -## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd -## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee - -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. - -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Copyright (C) 2009 Red Hat, Inc., Joey Boggs +# Copyright (C) 2012 Rackspace US, Inc., +# Justin Shepherd +# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py index c8932784..97cb06e2 100644 --- a/sos/plugins/openstack_swift.py +++ b/sos/plugins/openstack_swift.py @@ -1,25 +1,26 @@ -## Copyright (C) 2013 Red Hat, Inc., Flavio Percoco -## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd -## Copyright (C) 2009 Red Hat, Inc., Joey Boggs +# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco +# Copyright (C) 2012 Rackspace US, Inc., +# Justin Shepherd +# Copyright (C) 2009 Red Hat, Inc., Joey Boggs -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos import plugins +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class OpenStackSwift(plugins.Plugin): +class OpenStackSwift(Plugin): """OpenstackSwift related information.""" plugin_name = "openstack-swift" @@ -29,7 +30,8 @@ class OpenStackSwift(plugins.Plugin): # Swift self.add_copy_spec("/etc/swift/") -class DebianOpenStackSwift(OpenStackSwift, plugins.DebianPlugin, plugins.UbuntuPlugin): + +class DebianOpenStackSwift(OpenStackSwift, DebianPlugin, UbuntuPlugin): """OpenStackSwift related information for Debian based distributions.""" packages = ( @@ -44,7 +46,7 @@ class DebianOpenStackSwift(OpenStackSwift, plugins.DebianPlugin, plugins.UbuntuP ) -class RedHatOpenStackSwift(OpenStackSwift, plugins.RedHatPlugin): +class RedHatOpenStackSwift(OpenStackSwift, RedHatPlugin): """OpenStackSwift related information for Red Hat distributions.""" packages = ( diff --git a/sos/plugins/openswan.py b/sos/plugins/openswan.py index 77c3ace2..a44797fd 100644 --- a/sos/plugins/openswan.py +++ b/sos/plugins/openswan.py @@ -1,29 +1,30 @@ -## Copyright (C) 2007 Sadique Puthen +# Copyright (C) 2007 Sadique Puthen -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Openswan(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """ipsec related information """ plugin_name = 'openswan' option_list = [("ipsec-barf", - "collect the output of the ipsec barf command", - "slow", False)] + "collect the output of the ipsec barf command", + "slow", False)] files = ('/etc/ipsec.conf',) packages = ('openswan',) diff --git a/sos/plugins/ovirt.py b/sos/plugins/ovirt.py index 6cfb49cf..f365e151 100644 --- a/sos/plugins/ovirt.py +++ b/sos/plugins/ovirt.py @@ -1,20 +1,20 @@ -## Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola -## Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves -## Copyright (C) 2010 Red Hat, Inc. +# Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola +# Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves +# Copyright (C) 2010 Red Hat, Inc. -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import os import re @@ -54,8 +54,10 @@ class Ovirt(Plugin, RedHatPlugin): plugin_name = "ovirt" option_list = [ - ('jbosstrace', 'Enable oVirt Engine JBoss stack trace collection', '', True), - ('sensitive_keys', 'Sensitive keys to be masked', '', DEFAULT_SENSITIVE_KEYS) + ('jbosstrace', 'Enable oVirt Engine JBoss stack trace collection', + '', True), + ('sensitive_keys', 'Sensitive keys to be masked', + '', DEFAULT_SENSITIVE_KEYS) ] def setup(self): @@ -149,7 +151,7 @@ class Ovirt(Plugin, RedHatPlugin): ) sensitive_keys = self.DEFAULT_SENSITIVE_KEYS - #Handle --alloptions case which set this to True. + # Handle --alloptions case which set this to True. keys_opt = self.get_option('sensitive_keys') if keys_opt and keys_opt is not True: sensitive_keys = keys_opt diff --git a/sos/plugins/pam.py b/sos/plugins/pam.py index a6658e75..4d046b1b 100644 --- a/sos/plugins/pam.py +++ b/sos/plugins/pam.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Pam(Plugin): """PAM related information """ @@ -28,6 +29,7 @@ class Pam(Plugin): ]) self.add_cmd_output("ls -lanF %s" % self.security_libs) + class RedHatPam(Pam, RedHatPlugin): """PAM related information for RedHat based distribution """ diff --git a/sos/plugins/pci.py b/sos/plugins/pci.py index 80bbaebe..f62657cc 100644 --- a/sos/plugins/pci.py +++ b/sos/plugins/pci.py @@ -1,20 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin -from glob import glob -import os + class Pci(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): """PCI device related information @@ -29,12 +28,10 @@ class Pci(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): "/proc/bus/pci" ]) - self.add_cmd_output("lspci", root_symlink = "lspci") + self.add_cmd_output("lspci", root_symlink="lspci") self.add_cmd_outputs([ "lspci -nvv", "lspci -tv" ]) - - # vim: et ts=4 sw=4 diff --git a/sos/plugins/pcp.py b/sos/plugins/pcp.py index f3d18c2c..80e14067 100644 --- a/sos/plugins/pcp.py +++ b/sos/plugins/pcp.py @@ -143,7 +143,8 @@ class Pcp(Plugin, RedHatPlugin, DebianPlugin): os.path.join(self.pcp_log_dir, 'NOTICES*'), # Collect PCP_VAR_DIR/pmns os.path.join(self.pcp_var_dir, 'pmns'), - # Also collect any other log and config files (as suggested by fche) + # Also collect any other log and config files + # (as suggested by fche) os.path.join(self.pcp_log_dir, '*/*.log*'), os.path.join(self.pcp_log_dir, '*/*/*.log*'), os.path.join(self.pcp_log_dir, '*/*/config*') diff --git a/sos/plugins/postfix.py b/sos/plugins/postfix.py index 3d7df7aa..446c9e66 100644 --- a/sos/plugins/postfix.py +++ b/sos/plugins/postfix.py @@ -1,19 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -from os.path import exists + class Postfix(Plugin): """mail server related information @@ -29,6 +29,7 @@ class Postfix(Plugin): ]) self.add_cmd_output("postconf") + class RedHatPostfix(Postfix, RedHatPlugin): """mail server related information for RedHat based distributions """ @@ -40,6 +41,7 @@ class RedHatPostfix(Postfix, RedHatPlugin): super(RedHatPostfix, self).setup() self.add_copy_spec("/etc/mail") + class DebianPostfix(Postfix, DebianPlugin, UbuntuPlugin): """mail server related information for Debian based Distribution """ diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py index 9eac7ca8..45ec7d36 100644 --- a/sos/plugins/postgresql.py +++ b/sos/plugins/postgresql.py @@ -1,21 +1,21 @@ -## Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola -## Copyright (C) 2013 Chris J Arges -## Copyright (C) 2012-2013 Red Hat, Inc., Bryn M. Reeves -## Copyright (C) 2011 Red Hat, Inc., Jesse Jaggars +# Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola +# Copyright (C) 2013 Chris J Arges +# Copyright (C) 2012-2013 Red Hat, Inc., Bryn M. Reeves +# Copyright (C) 2011 Red Hat, Inc., Jesse Jaggars -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import os import tempfile @@ -70,7 +70,8 @@ class PostgreSQL(Plugin): "Unable to execute pg_dump. Error(%s)" % (result['output']) ) self.add_alert( - "ERROR: Unable to execute pg_dump. Error(%s)" % (result['output']) + "ERROR: Unable to execute pg_dump. Error(%s)" % + (result['output']) ) def setup(self): diff --git a/sos/plugins/powerpc.py b/sos/plugins/powerpc.py index 34808871..c829a5fb 100644 --- a/sos/plugins/powerpc.py +++ b/sos/plugins/powerpc.py @@ -1,23 +1,24 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -## This plugin enables collection of logs for Power systems and more -## specific logs for Pseries, PowerNV platforms. +# This plugin enables collection of logs for Power systems and more +# specific logs for Pseries, PowerNV platforms. import os from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin + class PowerPC(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): """IBM Power System related information """ diff --git a/sos/plugins/ppp.py b/sos/plugins/ppp.py index e8d300a3..ed88020e 100644 --- a/sos/plugins/ppp.py +++ b/sos/plugins/ppp.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Sadique Puthen +# Copyright (C) 2007 Sadique Puthen -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Ppp(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """ppp, wvdial and rp-pppoe related information """ diff --git a/sos/plugins/procenv.py b/sos/plugins/procenv.py index 4367555f..a38bd4c9 100644 --- a/sos/plugins/procenv.py +++ b/sos/plugins/procenv.py @@ -1,20 +1,21 @@ -## Copyright (c) 2012 Adam Stokes -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# Copyright (c) 2012 Adam Stokes +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, DebianPlugin, UbuntuPlugin + class Procenv(Plugin, DebianPlugin, UbuntuPlugin): """Process environment. """ diff --git a/sos/plugins/process.py b/sos/plugins/process.py index 553cdf68..ae6e5ef7 100644 --- a/sos/plugins/process.py +++ b/sos/plugins/process.py @@ -1,19 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -import os + class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """process information @@ -22,9 +22,9 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): plugin_name = 'process' def setup(self): - self.add_cmd_output("ps auxwww", root_symlink = "ps") - self.add_cmd_output("pstree", root_symlink = "pstree") - self.add_cmd_output("lsof -b +M -n -l", root_symlink = "lsof") + self.add_cmd_output("ps auxwww", root_symlink="ps") + self.add_cmd_output("pstree", root_symlink="pstree") + self.add_cmd_output("lsof -b +M -n -l", root_symlink="lsof") self.add_cmd_outputs([ "ps auxwwwm", "ps alxwww" diff --git a/sos/plugins/processor.py b/sos/plugins/processor.py index 603f963b..cc35a041 100644 --- a/sos/plugins/processor.py +++ b/sos/plugins/processor.py @@ -1,20 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin -from glob import glob -import os + class Processor(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): """CPU information @@ -30,7 +29,7 @@ class Processor(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): "/sys/class/cpuid", "/sys/devices/system/cpu" ]) - + self.add_cmd_outputs([ "lscpu", "cpupower info", diff --git a/sos/plugins/psacct.py b/sos/plugins/psacct.py index dadd62a2..ffbadfeb 100644 --- a/sos/plugins/psacct.py +++ b/sos/plugins/psacct.py @@ -1,27 +1,28 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Psacct(Plugin): """Process accounting related information """ option_list = [("all", "collect all process accounting files", - "slow", False)] + "slow", False)] - packages = [ "psacct" ] + packages = ["psacct"] class RedHatPsacct(Psacct, RedHatPlugin): @@ -29,7 +30,7 @@ class RedHatPsacct(Psacct, RedHatPlugin): """ plugin_name = "psacct" - packages = [ "psacct" ] + packages = ["psacct"] def setup(self): super(RedHatPsacct, self).setup() @@ -37,12 +38,13 @@ class RedHatPsacct(Psacct, RedHatPlugin): if self.get_option("all"): self.add_copy_spec("/var/account/pacct*.gz") + class DebianPsacct(Psacct, DebianPlugin, UbuntuPlugin): """Process accounting related information for Debian based distributions """ plugin_name = "acct" - packages = [ "acct" ] + packages = ["acct"] def setup(self): super(DebianPsacct, self).setup() diff --git a/sos/plugins/pxe.py b/sos/plugins/pxe.py index faead46a..d1bcdde6 100644 --- a/sos/plugins/pxe.py +++ b/sos/plugins/pxe.py @@ -1,26 +1,26 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -from os.path import exists + class Pxe(Plugin): """PXE related information """ option_list = [("tftpboot", 'gathers content from the tftpboot path', - 'slow', False)] + 'slow', False)] plugin_name = "pxe" diff --git a/sos/plugins/qpid.py b/sos/plugins/qpid.py index 1e711ee5..3a97d3b7 100644 --- a/sos/plugins/qpid.py +++ b/sos/plugins/qpid.py @@ -1,19 +1,20 @@ -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Qpid(Plugin, RedHatPlugin): """Messaging related information """ @@ -25,29 +26,29 @@ class Qpid(Plugin, RedHatPlugin): def setup(self): """ performs data collection for qpid broker """ self.add_cmd_outputs([ - "qpid-stat -g", # applies since 0.18 version - "qpid-stat -b", # applies to pre-0.18 versions + "qpid-stat -g", # applies since 0.18 version + "qpid-stat -b", # applies to pre-0.18 versions "qpid-stat -c", "qpid-stat -e", "qpid-stat -q", "qpid-stat -u", - "qpid-stat -m", # applies since 0.18 version + "qpid-stat -m", # applies since 0.18 version "qpid-config exchanges" "qpid-config queues" - "qpid-config exchanges -b", # applies to pre-0.18 versions - "qpid-config queues -b", # applies to pre-0.18 versions - "qpid-config exchanges -r", # applies since 0.18 version - "qpid-config queues -r", # applies since 0.18 version + "qpid-config exchanges -b", # applies to pre-0.18 versions + "qpid-config queues -b", # applies to pre-0.18 versions + "qpid-config exchanges -r", # applies since 0.18 version + "qpid-config queues -r", # applies since 0.18 version "qpid-route link list", "qpid-route route list", - "qpid-cluster", # applies to pre-0.22 versions - "qpid-ha query", # applies since 0.22 version + "qpid-cluster", # applies to pre-0.22 versions + "qpid-ha query", # applies since 0.22 version "ls -lanR /var/lib/qpidd" ]) self.add_copy_specs([ - "/etc/qpidd.conf", # applies to pre-0.22 versions - "/etc/qpid/qpidd.conf", # applies since 0.22 version + "/etc/qpidd.conf", # applies to pre-0.22 versions + "/etc/qpid/qpidd.conf", # applies since 0.22 version "/var/lib/qpid/syslog", "/etc/ais/openais.conf", "/var/log/cumin.log", diff --git a/sos/plugins/quagga.py b/sos/plugins/quagga.py index 88a41a76..da33176f 100644 --- a/sos/plugins/quagga.py +++ b/sos/plugins/quagga.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Ranjith Rajaram +# Copyright (C) 2007 Ranjith Rajaram -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Quagga(Plugin, RedHatPlugin): """quagga related information """ diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py index 03b696d1..28465de2 100644 --- a/sos/plugins/rabbitmq.py +++ b/sos/plugins/rabbitmq.py @@ -1,16 +1,16 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin diff --git a/sos/plugins/radius.py b/sos/plugins/radius.py index 5836812c..845f403a 100644 --- a/sos/plugins/radius.py +++ b/sos/plugins/radius.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Navid Sheikhol-Eslami +# Copyright (C) 2007 Navid Sheikhol-Eslami -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Radius(Plugin): """radius related information """ @@ -23,6 +24,7 @@ class Radius(Plugin): plugin_name = "radius" packages = ('freeradius',) + class RedHatRadius(Radius, RedHatPlugin): """radius related information on Red Hat distributions """ @@ -38,7 +40,9 @@ class RedHatRadius(Radius, RedHatPlugin): ]) def postproc(self): - self.do_file_sub("/etc/raddb/sql.conf", r"(\s*password\s*=\s*)\S+", r"\1***") + self.do_file_sub( + "/etc/raddb/sql.conf", r"(\s*password\s*=\s*)\S+", r"\1***") + class DebianRadius(Radius, DebianPlugin, UbuntuPlugin): """radius related information on Debian distributions diff --git a/sos/plugins/rhui.py b/sos/plugins/rhui.py index a0ef5129..dfd0c0fd 100644 --- a/sos/plugins/rhui.py +++ b/sos/plugins/rhui.py @@ -1,19 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -import os + class Rhui(Plugin, RedHatPlugin): """Red Hat Update Infrastructure for Cloud Providers data @@ -23,8 +23,8 @@ class Rhui(Plugin, RedHatPlugin): rhui_debug_path = "/usr/share/rh-rhua/rhui-debug.py" - packages = [ "rh-rhui-tools" ] - files = [ rhui_debug_path ] + packages = ["rh-rhui-tools"] + files = [rhui_debug_path] def setup(self): if self.is_installed("pulp-cds"): @@ -33,9 +33,10 @@ class Rhui(Plugin, RedHatPlugin): cds = "" rhui_debug_dst_path = self.get_cmd_output_path() - self.add_cmd_output("python %s %s --dir %s" - % (self.rhui_debug_path, cds, rhui_debug_dst_path), - suggest_filename="rhui-debug") + self.add_cmd_output( + "python %s %s --dir %s" + % (self.rhui_debug_path, cds, rhui_debug_dst_path), + suggest_filename="rhui-debug") return # vim: et ts=4 sw=4 diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py index 78bbad44..83dc41e6 100644 --- a/sos/plugins/rpm.py +++ b/sos/plugins/rpm.py @@ -1,27 +1,29 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Rpm(Plugin, RedHatPlugin): """RPM information """ plugin_name = 'rpm' - option_list = [("rpmq", "queries for package information via rpm -q", "fast", True), - ("rpmva", "runs a verify on all packages", "slow", False)] + option_list = [("rpmq", "queries for package information via rpm -q", + "fast", True), + ("rpmva", "runs a verify on all packages", "slow", False)] verify_list = [ 'kernel$', 'glibc', 'initscripts', @@ -36,17 +38,21 @@ class Rpm(Plugin, RedHatPlugin): if self.get_option("rpmq"): query_fmt = '"%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' - query_fmt = query_fmt + '~~%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n"' + query_fmt = query_fmt + \ + '~~%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n"' rpmq_cmd = "rpm --nosignature --nodigest -qa --qf=%s" % query_fmt - filter_cmd = 'awk -F "~~" "{printf \\"%-59s %s\\n\\",\$1,\$2}"|sort' + filter_cmd = 'awk -F "~~" ' \ + '"{printf \\"%-59s %s\\n\\",\$1,\$2}"|sort' shell_cmd = "sh -c '%s'" % (rpmq_cmd + "|" + filter_cmd) - self.add_cmd_output(shell_cmd, root_symlink = "installed-rpms") + self.add_cmd_output(shell_cmd, root_symlink="installed-rpms") if self.get_option("verify"): if self.get_option("rpmva"): - self.add_cmd_output("rpm -Va", root_symlink="rpm-Va", timeout=180) + self.add_cmd_output("rpm -Va", root_symlink="rpm-Va", + timeout=180) else: - pkgs_by_regex = self.policy().package_manager.all_pkgs_by_name_regex + pkgs_by_regex = \ + self.policy().package_manager.all_pkgs_by_name_regex verify_list = map(pkgs_by_regex, self.verify_list) verify_pkgs = "" for pkg_list in verify_list: diff --git a/sos/plugins/s390.py b/sos/plugins/s390.py index b9401880..d7fd0305 100644 --- a/sos/plugins/s390.py +++ b/sos/plugins/s390.py @@ -1,33 +1,34 @@ -## Copyright (C) 2007 Red Hat, Inc., Justin Payne +# Copyright (C) 2007 Red Hat, Inc., Justin Payne -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class S390(Plugin, RedHatPlugin): """s390 related information """ plugin_name = 's390' - ### Check for s390 arch goes here + # Check for s390 arch goes here def check_enabled(self): return (self.policy().get_arch() == "s390") - ### Gather s390 specific information + # Gather s390 specific information def setup(self): self.add_copy_specs([ diff --git a/sos/plugins/samba.py b/sos/plugins/samba.py index 9183d07e..2fdf48e1 100644 --- a/sos/plugins/samba.py +++ b/sos/plugins/samba.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Samba(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """Samba related information """ diff --git a/sos/plugins/sanlock.py b/sos/plugins/sanlock.py index f878bda7..4a2667bd 100644 --- a/sos/plugins/sanlock.py +++ b/sos/plugins/sanlock.py @@ -1,24 +1,25 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class SANLock(Plugin): """sanlock-related information """ plugin_name = "sanlock" - packages = [ "sanlock" ] + packages = ["sanlock"] def setup(self): self.add_copy_spec("/var/log/sanlock.log*") @@ -29,9 +30,10 @@ class SANLock(Plugin): ]) return + class RedHatSANLock(SANLock, RedHatPlugin): - files = [ "/etc/sysconfig/sanlock" ] + files = ["/etc/sysconfig/sanlock"] def setup(self): super(RedHatSANLock, self).setup() diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index 3ee96c16..e680e511 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -1,20 +1,21 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin import os + class Sar(Plugin,): """ Collect system activity reporter data """ @@ -23,7 +24,8 @@ class Sar(Plugin,): packages = ('sysstat',) sa_path = '/var/log/sa' - option_list = [("all_sar", "gather all system activity records", "", False)] + option_list = [("all_sar", "gather all system activity records", + "", False)] # size-limit SAR data collected by default (MB) sa_size = 20 @@ -37,11 +39,11 @@ class Sar(Plugin,): for suffix in ('', '.*'): self.add_copy_spec_limit( os.path.join(self.sa_path, "sa[0-3][0-9]" + suffix), - sizelimit = self.sa_size, tailit=False + sizelimit=self.sa_size, tailit=False ) self.add_copy_spec_limit( os.path.join(self.sa_path, "sar[0-3][0-9]" + suffix), - sizelimit = self.sa_size, tailit=False + sizelimit=self.sa_size, tailit=False ) try: diff --git a/sos/plugins/satellite.py b/sos/plugins/satellite.py index 1d8da5ce..9fb9cdd4 100644 --- a/sos/plugins/satellite.py +++ b/sos/plugins/satellite.py @@ -1,19 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -import os + class Satellite(Plugin, RedHatPlugin): """RHN Satellite and Spacewalk related information @@ -30,11 +30,11 @@ class Satellite(Plugin, RedHatPlugin): def rhn_package_check(self): self.satellite = self.is_installed("rhns-satellite-tools") \ - or self.is_installed("spacewalk-java") \ - or self.is_installed("rhn-base") + or self.is_installed("spacewalk-java") \ + or self.is_installed("rhn-base") self.proxy = self.is_installed("rhns-proxy-tools") \ - or self.is_installed("spacewalk-proxy-management") \ - or self.is_installed("rhn-proxy-management") + or self.is_installed("spacewalk-proxy-management") \ + or self.is_installed("rhn-proxy-management") return self.satellite or self.proxy def check_enabled(self): @@ -72,9 +72,9 @@ class Satellite(Plugin, RedHatPlugin): self.add_copy_spec("/root/ssl-build") self.add_cmd_output("rhn-schema-version", - root_symlink = "database-schema-version") + root_symlink="database-schema-version") self.add_cmd_output("rhn-charsets", - root_symlink = "database-character-sets") + root_symlink="database-character-sets") if self.satellite: self.add_copy_specs([ @@ -83,8 +83,9 @@ class Satellite(Plugin, RedHatPlugin): "/etc/tomcat6/", "/var/log/tomcat6/" ]) - self.add_cmd_output("spacewalk-debug --dir %s" - % self.get_cmd_output_path(name="spacewalk-debug")) + self.add_cmd_output( + "spacewalk-debug --dir %s" + % self.get_cmd_output_path(name="spacewalk-debug")) if self.proxy: self.add_copy_specs(["/etc/squid", "/var/log/squid"]) diff --git a/sos/plugins/scsi.py b/sos/plugins/scsi.py index 3f877964..4d8d179f 100644 --- a/sos/plugins/scsi.py +++ b/sos/plugins/scsi.py @@ -1,20 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin -from glob import glob -import os + class Scsi(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): """hardware related information @@ -32,7 +31,7 @@ class Scsi(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): "/sys/class/scsi_device", "/sys/class/scsi_generic" ]) - + self.add_cmd_outputs([ "lsscsi", "sg_map" diff --git a/sos/plugins/selinux.py b/sos/plugins/selinux.py index 65e24624..ee558665 100644 --- a/sos/plugins/selinux.py +++ b/sos/plugins/selinux.py @@ -1,19 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -from os.path import join + class SELinux(Plugin, RedHatPlugin): """selinux related information @@ -21,7 +21,8 @@ class SELinux(Plugin, RedHatPlugin): plugin_name = 'selinux' - option_list = [("fixfiles", 'Print incorrect file context labels', 'slow', False), + option_list = [("fixfiles", 'Print incorrect file context labels', + 'slow', False), ("list", 'List objects and their context', 'slow', False)] packages = ('libselinux',) diff --git a/sos/plugins/sendmail.py b/sos/plugins/sendmail.py index 5067d0c0..44c7480f 100644 --- a/sos/plugins/sendmail.py +++ b/sos/plugins/sendmail.py @@ -1,27 +1,27 @@ -## Copyright (C) 2007 Red Hat, Inc., Eugene Teo +# Copyright (C) 2007 Red Hat, Inc., Eugene Teo -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -from os.path import exists + class Sendmail(Plugin): """sendmail information """ - plugin_name = "sendmail" + plugin_name = "sendmail" packages = ('sendmail',) @@ -40,6 +40,7 @@ class RedHatSendmail(Sendmail, RedHatPlugin): "/var/log/maillog" ]) + class DebianSendmail(Sendmail, DebianPlugin, UbuntuPlugin): """sendmail information for Debian based distributions """ diff --git a/sos/plugins/smartcard.py b/sos/plugins/smartcard.py index 146c8018..3cebacee 100644 --- a/sos/plugins/smartcard.py +++ b/sos/plugins/smartcard.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Sadique Puthen +# Copyright (C) 2007 Sadique Puthen -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Smartcard(Plugin, RedHatPlugin): """Smart Card related information """ diff --git a/sos/plugins/snmp.py b/sos/plugins/snmp.py index a9026d1d..6a57fa51 100644 --- a/sos/plugins/snmp.py +++ b/sos/plugins/snmp.py @@ -1,21 +1,21 @@ -## Copyright (C) 2007 Sadique Puthen +# Copyright (C) 2007 Sadique Puthen -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -from os.path import exists + class Snmp(Plugin): """snmp related information @@ -27,6 +27,7 @@ class Snmp(Plugin): def setup(self): self.add_copy_spec("/etc/snmp") + class RedHatSnmp(Snmp, RedHatPlugin): """snmp related information for RedHat based distributions """ @@ -36,6 +37,7 @@ class RedHatSnmp(Snmp, RedHatPlugin): def setup(self): super(RedHatSnmp, self).setup() + class DebianSnmp(Snmp, DebianPlugin, UbuntuPlugin): """snmp related information for Debian based distributions """ diff --git a/sos/plugins/soundcard.py b/sos/plugins/soundcard.py index 24e8767c..2b2b11e9 100644 --- a/sos/plugins/soundcard.py +++ b/sos/plugins/soundcard.py @@ -1,19 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -import os + class Soundcard(Plugin): """ Sound card information @@ -32,6 +32,7 @@ class Soundcard(Plugin): "amixer" ]) + class RedHatSoundcard(Soundcard, RedHatPlugin): """ Sound card information for RedHat distros """ @@ -44,6 +45,7 @@ class RedHatSoundcard(Soundcard, RedHatPlugin): "/etc/asound.*" ]) + class DebianSoundcard(Soundcard, DebianPlugin, UbuntuPlugin): """ Sound card information for Debian/Ubuntu distros """ diff --git a/sos/plugins/squid.py b/sos/plugins/squid.py index 848ab530..a3ad96d3 100644 --- a/sos/plugins/squid.py +++ b/sos/plugins/squid.py @@ -1,16 +1,16 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. - -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin diff --git a/sos/plugins/ssh.py b/sos/plugins/ssh.py index c95e263c..8918f423 100644 --- a/sos/plugins/ssh.py +++ b/sos/plugins/ssh.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Red Hat, Inc., Eugene Teo +# Copyright (C) 2007 Red Hat, Inc., Eugene Teo -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Ssh(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """ssh-related information """ diff --git a/sos/plugins/sssd.py b/sos/plugins/sssd.py index c6069e1c..8dac049c 100644 --- a/sos/plugins/sssd.py +++ b/sos/plugins/sssd.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Red Hat, Inc., Pierre Carrier +# Copyright (C) 2007 Red Hat, Inc., Pierre Carrier -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Sssd(Plugin): """sssd-related Diagnostic Information """ @@ -31,8 +32,9 @@ class Sssd(Plugin): def postproc(self): self.do_file_sub("/etc/sssd/sssd.conf", - r"(\s*ldap_default_authtok\s*=\s*)\S+", - r"\1********") + r"(\s*ldap_default_authtok\s*=\s*)\S+", + r"\1********") + class RedHatSssd(Sssd, RedHatPlugin): """sssd-related Diagnostic Information on Red Hat based distributions @@ -41,6 +43,7 @@ class RedHatSssd(Sssd, RedHatPlugin): def setup(self): super(RedHatSssd, self).setup() + class DebianSssd(Sssd, DebianPlugin, UbuntuPlugin): """sssd-related Diagnostic Information on Debian based distributions """ diff --git a/sos/plugins/startup.py b/sos/plugins/startup.py index 60d40865..575801ac 100644 --- a/sos/plugins/startup.py +++ b/sos/plugins/startup.py @@ -1,31 +1,35 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Startup(Plugin): """startup information """ plugin_name = "startup" - option_list = [("servicestatus", "get a status of all running services", "slow", False)] + option_list = [("servicestatus", "get a status of all running services", + "slow", False)] + def setup(self): if self.get_option('servicestatus'): self.add_cmd_output("/sbin/service --status-all") self.add_cmd_output("/sbin/runlevel") + class RedHatStartup(Startup, RedHatPlugin): """startup information for RedHat based distributions """ @@ -33,7 +37,8 @@ class RedHatStartup(Startup, RedHatPlugin): def setup(self): super(RedHatStartup, self).setup() self.add_copy_spec("/etc/rc.d") - self.add_cmd_output("/sbin/chkconfig --list", root_symlink = "chkconfig") + self.add_cmd_output("/sbin/chkconfig --list", root_symlink="chkconfig") + class DebianStartup(Startup, DebianPlugin, UbuntuPlugin): """startup information @@ -43,7 +48,8 @@ class DebianStartup(Startup, DebianPlugin, UbuntuPlugin): super(DebianStartup, self).setup() self.add_copy_spec("/etc/rc*.d") - self.add_cmd_output("/sbin/initctl show-config", root_symlink = "initctl") + self.add_cmd_output("/sbin/initctl show-config", + root_symlink="initctl") if self.get_option('servicestatus'): self.add_cmd_output("/sbin/initctl list") diff --git a/sos/plugins/sunrpc.py b/sos/plugins/sunrpc.py index 124f2fa1..02512c11 100644 --- a/sos/plugins/sunrpc.py +++ b/sos/plugins/sunrpc.py @@ -1,21 +1,22 @@ -## Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves +# Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class SunRPC(Plugin): """Sun RPC related information """ @@ -25,7 +26,7 @@ class SunRPC(Plugin): def check_enabled(self): if self.policy().default_runlevel() in \ - self.policy().runlevel_by_service(self.service): + self.policy().runlevel_by_service(self.service): return True return False @@ -33,6 +34,7 @@ class SunRPC(Plugin): self.add_cmd_output("rpcinfo -p localhost") return + class RedHatSunRPC(SunRPC, RedHatPlugin): """Sun RPC related information for Red Hat systems """ @@ -41,7 +43,7 @@ class RedHatSunRPC(SunRPC, RedHatPlugin): # FIXME: depends on addition of runlevel_by_service (or similar) # in Debian/Ubuntu policy classes -#class DebianSunRPC(SunRPC, DebianPlugin, UbuntuPlugin): +# class DebianSunRPC(SunRPC, DebianPlugin, UbuntuPlugin): # """Sun RPC related information for Red Hat systems # """ # @@ -51,6 +53,4 @@ class RedHatSunRPC(SunRPC, RedHatPlugin): # self.add_cmd_output("rpcinfo -p localhost") # return - - # vim: et ts=4 sw=4 diff --git a/sos/plugins/system.py b/sos/plugins/system.py index a8192249..8bb50e3c 100644 --- a/sos/plugins/system.py +++ b/sos/plugins/system.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class System(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """core system related information """ @@ -23,9 +24,9 @@ class System(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): def setup(self): self.add_copy_spec("/proc/sys") self.add_forbidden_path( - "/proc/sys/net/ipv6/neigh/*/retrans_time") + "/proc/sys/net/ipv6/neigh/*/retrans_time") self.add_forbidden_path( - "/proc/sys/net/ipv6/neigh/*/base_reachable_time") + "/proc/sys/net/ipv6/neigh/*/base_reachable_time") # vim: et ts=4 sw=4 diff --git a/sos/plugins/systemd.py b/sos/plugins/systemd.py index 6024be29..d7be9fc4 100644 --- a/sos/plugins/systemd.py +++ b/sos/plugins/systemd.py @@ -1,21 +1,22 @@ -## Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves +# Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Systemd(Plugin, RedHatPlugin): """ Information on systemd and related subsystems """ diff --git a/sos/plugins/systemtap.py b/sos/plugins/systemtap.py index 170d0c16..32d92a17 100644 --- a/sos/plugins/systemtap.py +++ b/sos/plugins/systemtap.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Red Hat, Inc., Eugene Teo +# Copyright (C) 2007 Red Hat, Inc., Eugene Teo -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class SystemTap(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """SystemTap information """ diff --git a/sos/plugins/sysvipc.py b/sos/plugins/sysvipc.py index 803b808b..53265c4a 100644 --- a/sos/plugins/sysvipc.py +++ b/sos/plugins/sysvipc.py @@ -1,20 +1,21 @@ -## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class SysVIPC(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """SysV IPC related information """ diff --git a/sos/plugins/tftpserver.py b/sos/plugins/tftpserver.py index 49c69b51..96c0bedc 100644 --- a/sos/plugins/tftpserver.py +++ b/sos/plugins/tftpserver.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Shijoe George +# Copyright (C) 2007 Shijoe George -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class TftpServer(Plugin, RedHatPlugin): """tftpserver related information """ diff --git a/sos/plugins/tomcat.py b/sos/plugins/tomcat.py index e6135de9..68949371 100644 --- a/sos/plugins/tomcat.py +++ b/sos/plugins/tomcat.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Tomcat(Plugin, RedHatPlugin): """Tomcat related information """ diff --git a/sos/plugins/tuned.py b/sos/plugins/tuned.py index e6feb0ac..29c9a0f7 100644 --- a/sos/plugins/tuned.py +++ b/sos/plugins/tuned.py @@ -1,21 +1,22 @@ -## Copyright (C) 2014 Red Hat, Inc., Peter Portante +# Copyright (C) 2014 Red Hat, Inc., Peter Portante -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Tuned(Plugin, RedHatPlugin): """Tuned related information """ diff --git a/sos/plugins/udev.py b/sos/plugins/udev.py index e554a886..ec330fc8 100644 --- a/sos/plugins/udev.py +++ b/sos/plugins/udev.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Udev(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """Udev related information """ diff --git a/sos/plugins/upstart.py b/sos/plugins/upstart.py index b9ced84a..721cc297 100644 --- a/sos/plugins/upstart.py +++ b/sos/plugins/upstart.py @@ -1,18 +1,18 @@ -## Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves +# Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin diff --git a/sos/plugins/usb.py b/sos/plugins/usb.py index 94349ec1..634e204b 100644 --- a/sos/plugins/usb.py +++ b/sos/plugins/usb.py @@ -1,20 +1,19 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin -from glob import glob -import os + class Usb(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """USB device related information @@ -31,6 +30,4 @@ class Usb(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): "lsusb -t" ]) - - # vim: et ts=4 sw=4 diff --git a/sos/plugins/veritas.py b/sos/plugins/veritas.py index 607ad7ec..a04b0b2a 100644 --- a/sos/plugins/veritas.py +++ b/sos/plugins/veritas.py @@ -1,20 +1,21 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin import os + class Veritas(Plugin, RedHatPlugin): """Veritas related information """ @@ -23,8 +24,8 @@ class Veritas(Plugin, RedHatPlugin): # Information about VRTSexplorer obtained from # http://seer.entsupport.symantec.com/docs/243150.htm - option_list = [("script", "Define VRTSexplorer script path", "", - "/opt/VRTSspt/VRTSexplorer")] + option_list = [("script", "Define VRTSexplorer script path", "", + "/opt/VRTSspt/VRTSexplorer")] def check_enabled(self): return os.path.isfile(self.get_option("script")) diff --git a/sos/plugins/vmware.py b/sos/plugins/vmware.py index 1679c88c..7aa8e559 100644 --- a/sos/plugins/vmware.py +++ b/sos/plugins/vmware.py @@ -1,26 +1,27 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class VMWare(Plugin, RedHatPlugin): """VMWare related information """ plugin_name = 'vmware' - files = ('vmware','/usr/init.d/vmware-tools') + files = ('vmware', '/usr/init.d/vmware-tools') def setup(self): self.add_cmd_output("vmware -v") diff --git a/sos/plugins/vsftpd.py b/sos/plugins/vsftpd.py index ead74493..bc5846bc 100644 --- a/sos/plugins/vsftpd.py +++ b/sos/plugins/vsftpd.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Vsftpd(Plugin, RedHatPlugin): """FTP server related information """ diff --git a/sos/plugins/x11.py b/sos/plugins/x11.py index 7a548f45..c4ba3cf2 100644 --- a/sos/plugins/x11.py +++ b/sos/plugins/x11.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class X11(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """X related information """ diff --git a/sos/plugins/xen.py b/sos/plugins/xen.py index 40625895..99cd5dcb 100644 --- a/sos/plugins/xen.py +++ b/sos/plugins/xen.py @@ -1,22 +1,23 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin import os import re from stat import * + class Xen(Plugin, RedHatPlugin): """Xen related information """ @@ -30,7 +31,8 @@ class Xen(Plugin, RedHatPlugin): return "hvm" if os.access("/proc/xen/capabilities", os.R_OK): - result = self.call_ext_prog("grep -q control_d /proc/xen/capabilities") + result = self.call_ext_prog( + "grep -q control_d /proc/xen/capabilities") if result['status'] == 0: return "dom0" else: @@ -42,7 +44,7 @@ class Xen(Plugin, RedHatPlugin): def is_running_xenstored(self): xs_pid = self.call_ext_prof("pidof xenstored")['ouput'] - xs_pidnum = re.split('\n$',xs_pid)[0] + xs_pidnum = re.split('\n$', xs_pid)[0] return xs_pidnum.isdigit() def dom_collect_proc(self): @@ -97,7 +99,7 @@ class Xen(Plugin, RedHatPlugin): # useful, so I'll leave it out for now else: # for bare-metal, we don't have to do anything special - return #USEFUL + return # USEFUL self.add_custom_text("Xen hostType: "+host_type) diff --git a/sos/plugins/xfs.py b/sos/plugins/xfs.py index 3bef675a..9e92e7b3 100644 --- a/sos/plugins/xfs.py +++ b/sos/plugins/xfs.py @@ -1,22 +1,21 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -import os -import re from six.moves import zip + class Xfs(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """information on the XFS filesystem """ diff --git a/sos/plugins/xinetd.py b/sos/plugins/xinetd.py index bd4a03b3..951ddff0 100644 --- a/sos/plugins/xinetd.py +++ b/sos/plugins/xinetd.py @@ -1,21 +1,22 @@ -## Copyright (C) 2007 Red Hat, Inc., Eugene Teo +# Copyright (C) 2007 Red Hat, Inc., Eugene Teo -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + class Xinetd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """xinetd information """ diff --git a/sos/plugins/yum.py b/sos/plugins/yum.py index f2c81487..ff9390f9 100644 --- a/sos/plugins/yum.py +++ b/sos/plugins/yum.py @@ -1,19 +1,20 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin + class Yum(Plugin, RedHatPlugin): """yum information """ @@ -22,8 +23,9 @@ class Yum(Plugin, RedHatPlugin): files = ('/etc/yum.conf',) packages = ('yum',) - option_list = [("yumlist", "list repositories and packages", "slow", False), - ("yumdebug", "gather yum debugging data", "slow", False)] + option_list = [("yumlist", "list repositories and packages", "slow", + False), + ("yumdebug", "gather yum debugging data", "slow", False)] def setup(self): # Pull all yum related information @@ -50,8 +52,9 @@ class Yum(Plugin, RedHatPlugin): "subscription-manager list --installed", "subscription-manager list --consumed" ]) - self.add_cmd_output("rhsm-debug system --sos --no-archive --destination %s" - % self.get_cmd_output_path()) + self.add_cmd_output("rhsm-debug system --sos --no-archive " + "--destination %s" + % self.get_cmd_output_path()) if self.get_option("yumlist"): # List various information about available packages @@ -59,7 +62,8 @@ class Yum(Plugin, RedHatPlugin): if self.get_option("yumdebug") and self.is_installed('yum-utils'): # RHEL6+ alternative for this whole function: - # self.add_cmd_output("yum-debug-dump '%s'" % os.path.join(self.commons['dstroot'],"yum-debug-dump")) + # self.add_cmd_output("yum-debug-dump '%s'" + # % os.path.join(self.commons['dstroot'],"yum-debug-dump")) r = self.call_ext_prog("yum-debug-dump") try: self.add_cmd_output("zcat %s" % (r['output'].split()[-1],)) -- cgit