aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stokes <adam.stokes@ubuntu.com>2014-08-01 21:29:39 -0400
committerAdam Stokes <adam.stokes@ubuntu.com>2014-08-01 21:29:39 -0400
commite320ca865dc11057ea361c7a5446f9a3669764dc (patch)
treef7093e0d93c0a09bca1cd94c0a5f859a7affcc78
parent9961bcef8704dda0c11d22337c6aef4a3880bd89 (diff)
downloadsos-e320ca865dc11057ea361c7a5446f9a3669764dc.tar.gz
[plugins] more pep8/pyflake plugin cleanup
There's a lot of changes, however, it is primarily formatting of existing code and no new code is introduced. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r--sos/plugins/cgroups.py26
-rw-r--r--sos/plugins/cluster.py41
-rw-r--r--sos/plugins/cobbler.py27
-rw-r--r--sos/plugins/corosync.py24
-rw-r--r--sos/plugins/cron.py31
-rw-r--r--sos/plugins/cs.py32
-rw-r--r--sos/plugins/ctdb.py25
-rw-r--r--sos/plugins/cups.py29
-rw-r--r--sos/plugins/devicemapper.py24
-rw-r--r--sos/plugins/dhcp.py27
-rw-r--r--sos/plugins/distupgrade.py26
-rw-r--r--sos/plugins/dmraid.py26
-rw-r--r--sos/plugins/docker.py26
-rw-r--r--sos/plugins/dovecot.py26
-rw-r--r--sos/plugins/dpkg.py27
-rw-r--r--sos/plugins/ds.py32
-rw-r--r--sos/plugins/emc.py116
-rw-r--r--sos/plugins/filesys.py35
-rw-r--r--sos/plugins/firewalld.py31
-rw-r--r--sos/plugins/foreman.py26
-rw-r--r--sos/plugins/gdm.py23
-rw-r--r--sos/plugins/general.py31
-rw-r--r--sos/plugins/gluster.py60
-rw-r--r--sos/plugins/grub.py23
-rw-r--r--sos/plugins/grub2.py27
-rw-r--r--sos/plugins/haproxy.py25
-rw-r--r--sos/plugins/hardware.py29
-rw-r--r--sos/plugins/hpasm.py25
-rw-r--r--sos/plugins/hts.py23
-rw-r--r--sos/plugins/i18n.py23
-rw-r--r--sos/plugins/infiniband.py25
-rw-r--r--sos/plugins/ipa.py25
-rw-r--r--sos/plugins/ipsec.py27
-rw-r--r--sos/plugins/ipvs.py25
-rw-r--r--sos/plugins/iscsi.py26
-rw-r--r--sos/plugins/iscsitarget.py29
-rw-r--r--sos/plugins/java.py26
-rw-r--r--sos/plugins/juju.py1
-rw-r--r--sos/plugins/katello.py26
-rw-r--r--sos/plugins/kdump.py25
-rw-r--r--sos/plugins/keepalived.py25
-rw-r--r--sos/plugins/kernel.py27
-rw-r--r--sos/plugins/kernelrt.py9
-rw-r--r--sos/plugins/krb5.py25
-rw-r--r--sos/plugins/kvm.py29
-rw-r--r--sos/plugins/landscape.py29
-rw-r--r--sos/plugins/ldap.py45
-rw-r--r--sos/plugins/libraries.py23
-rw-r--r--sos/plugins/libvirt.py31
-rw-r--r--sos/plugins/lilo.py23
-rw-r--r--sos/plugins/logrotate.py23
-rw-r--r--sos/plugins/logs.py40
-rw-r--r--sos/plugins/lsbrelease.py28
-rw-r--r--sos/plugins/lvm2.py46
-rw-r--r--sos/plugins/md.py26
-rw-r--r--sos/plugins/megacli.py36
-rw-r--r--sos/plugins/memory.py25
-rw-r--r--sos/plugins/mongodb.py26
-rw-r--r--sos/plugins/mrggrid.py23
-rw-r--r--sos/plugins/mrgmessg.py23
-rw-r--r--sos/plugins/multipath.py24
-rw-r--r--sos/plugins/mysql.py24
-rw-r--r--sos/plugins/named.py27
-rw-r--r--sos/plugins/networking.py75
-rw-r--r--sos/plugins/nfs.py31
-rw-r--r--sos/plugins/nfsserver.py25
-rw-r--r--sos/plugins/nis.py27
-rw-r--r--sos/plugins/nscd.py27
-rw-r--r--sos/plugins/ntp.py23
-rw-r--r--sos/plugins/oddjob.py25
-rw-r--r--sos/plugins/openhpi.py26
-rw-r--r--sos/plugins/openshift.py54
-rw-r--r--sos/plugins/openssl.py27
-rw-r--r--sos/plugins/openstack_ceilometer.py43
-rw-r--r--sos/plugins/openstack_cinder.py36
75 files changed, 1180 insertions, 1057 deletions
diff --git a/sos/plugins/cgroups.py b/sos/plugins/cgroups.py
index 51dab130..225b0076 100644
--- a/sos/plugins/cgroups.py
+++ b/sos/plugins/cgroups.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 Cgroups(Plugin, DebianPlugin, UbuntuPlugin):
"""cgroup subsystem information
"""
@@ -29,6 +30,7 @@ class Cgroups(Plugin, DebianPlugin, UbuntuPlugin):
])
return
+
class RedHatCgroups(Cgroups, RedHatPlugin):
"""Red Hat specific cgroup subsystem information
"""
@@ -42,5 +44,5 @@ class RedHatCgroups(Cgroups, RedHatPlugin):
"/etc/cgconfig.conf",
"/etc/cgrules.conf"
])
-
+
# vim: et ts=4 sw=4
diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py
index c8240c3e..4f56cdef 100644
--- a/sos/plugins/cluster.py
+++ b/sos/plugins/cluster.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 re, os
+import re
from glob import glob
from datetime import datetime, timedelta
+
class Cluster(Plugin, RedHatPlugin):
"""cluster suite and GFS related information
"""
@@ -25,7 +26,7 @@ class Cluster(Plugin, RedHatPlugin):
option_list = [
("gfslockdump", 'gather output of gfs lockdumps', 'slow', False),
("crm_from", 'specify the start time for crm_report', 'fast', False),
- ('lockdump', 'gather dlm lockdumps', 'slow', False)
+ ('lockdump', 'gather dlm lockdumps', 'slow', False)
]
packages = [
@@ -38,7 +39,7 @@ class Cluster(Plugin, RedHatPlugin):
"pacemaker"
]
- files = [ "/etc/cluster/cluster.conf" ]
+ files = ["/etc/cluster/cluster.conf"]
def setup(self):
@@ -92,18 +93,18 @@ class Cluster(Plugin, RedHatPlugin):
# time in order to collect data.
crm_from = (datetime.today()
- timedelta(hours=72)).strftime("%Y-%m-%d %H:%m:%S")
- if self.get_option('crm_from') != False:
+ if self.get_option('crm_from') is not False:
if re.match(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}',
str(self.get_option('crm_from'))):
crm_from = self.get_option('crm_from')
else:
self.log_error(
- "crm_from parameter '%s' is not a valid date: using default"
- % self.get_option('crm_from'))
+ "crm_from parameter '%s' is not a valid date: using "
+ "default" % self.get_option('crm_from'))
crm_dest = self.get_cmd_output_path(name='crm_report')
self.add_cmd_output('crm_report -S -d --dest %s --from "%s"'
- % (crm_dest, crm_from))
+ % (crm_dest, crm_from))
def do_lockdump(self):
dlm_tool = "dlm_tool ls"
@@ -124,7 +125,7 @@ class Cluster(Plugin, RedHatPlugin):
for mnt in self.do_regex_find_all(mnt_exp, "/proc/mounts"):
self.add_cmd_output(
"gfs_tool lockdump %s" % mnt,
- suggest_filename="gfs_lockdump_" + self.mangle_command(mnt)
+ suggest_filename="gfs_lockdump_" + self.mangle_command(mnt)
)
def postproc(self):
@@ -132,7 +133,7 @@ class Cluster(Plugin, RedHatPlugin):
self.do_file_sub(
cluster_conf,
r"(\s*\<fencedevice\s*.*\s*passwd\s*=\s*)\S+(\")",
- r"\1%s" %('"***"')
+ r"\1%s" % ('"***"')
)
self.do_path_regex_sub(
diff --git a/sos/plugins/cobbler.py b/sos/plugins/cobbler.py
index 9e14be23..1591f623 100644
--- a/sos/plugins/cobbler.py
+++ b/sos/plugins/cobbler.py
@@ -1,22 +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.
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class Cobbler(Plugin):
plugin_name = "cobbler"
-
+
+
class RedHatCobbler(Cobbler, RedHatPlugin):
"""cobbler related information
"""
@@ -31,6 +33,7 @@ class RedHatCobbler(Cobbler, RedHatPlugin):
"/var/lib/cobbler"
])
+
class DebianCobbler(Cobbler, DebianPlugin, UbuntuPlugin):
"""cobbler related information for Debian and Ubuntu
"""
diff --git a/sos/plugins/corosync.py b/sos/plugins/corosync.py
index 06beb5e3..1433fb80 100644
--- a/sos/plugins/corosync.py
+++ b/sos/plugins/corosync.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 Corosync(Plugin):
""" corosync information
"""
@@ -38,6 +39,7 @@ class Corosync(Plugin):
])
self.call_ext_prog("killall -USR2 corosync")
+
class RedHatCorosync(Corosync, RedHatPlugin):
""" corosync information for RedHat based distribution
"""
diff --git a/sos/plugins/cron.py b/sos/plugins/cron.py
index ca3bedec..56bc740e 100644
--- a/sos/plugins/cron.py
+++ b/sos/plugins/cron.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 Cron(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Crontab information
"""
@@ -24,15 +25,15 @@ class Cron(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def setup(self):
self.add_copy_specs([
- "/etc/cron*",
- "/var/log/cron",
- "/var/spool/cron"
+ "/etc/cron*",
+ "/var/log/cron",
+ "/var/spool/cron"
])
if self.get_option("all_logs"):
self.add_copy_spec("/var/log/cron*")
self.add_cmd_output("crontab -l -u root",
- suggest_filename = "root_crontab")
+ suggest_filename="root_crontab")
# vim: et ts=4 sw=4
diff --git a/sos/plugins/cs.py b/sos/plugins/cs.py
index bc0c84b1..e51cf915 100644
--- a/sos/plugins/cs.py
+++ b/sos/plugins/cs.py
@@ -1,25 +1,26 @@
-## Copyright (C) 2007-2010 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
-## Marc Sauton <msauton@redhat.com>
-## Pierre Carrier <pcarrier@redhat.com>
+# Copyright (C) 2007-2010 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
+# Marc Sauton <msauton@redhat.com>
+# Pierre Carrier <pcarrier@redhat.com>
-### 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 exists
from glob import glob
+
class CertificateSystem(Plugin, RedHatPlugin):
"""Red Hat Certificate System 7.1, 7.3, 8.0 and dogtag related information
"""
@@ -41,7 +42,8 @@ class CertificateSystem(Plugin, RedHatPlugin):
def checkversion(self):
if self.is_installed("redhat-cs") or exists("/opt/redhat-cs"):
return 71
- elif self.is_installed("rhpki-common") or len(glob("/var/lib/rhpki-*")):
+ elif self.is_installed("rhpki-common") or \
+ len(glob("/var/lib/rhpki-*")):
return 73
# 8 should cover dogtag
elif self.is_installed("pki-common") or exists("/usr/share/java/pki"):
diff --git a/sos/plugins/ctdb.py b/sos/plugins/ctdb.py
index cf682966..d0a4b872 100644
--- a/sos/plugins/ctdb.py
+++ b/sos/plugins/ctdb.py
@@ -1,20 +1,21 @@
-## Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
+# 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 Ctdb(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Samba CTDB related information
"""
diff --git a/sos/plugins/cups.py b/sos/plugins/cups.py
index 05d5fe1b..0ab77793 100644
--- a/sos/plugins/cups.py
+++ b/sos/plugins/cups.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 Cups(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""printing related information (cups)
"""
@@ -25,8 +26,10 @@ class Cups(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def setup(self):
if not self.get_option("all_logs"):
limit = self.get_option("log_size")
- self.add_copy_spec_limit("/var/log/cups/access_log", sizelimit=limit)
- self.add_copy_spec_limit("/var/log/cups/error_log", sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/cups/access_log",
+ sizelimit=limit)
+ self.add_copy_spec_limit("/var/log/cups/error_log",
+ sizelimit=limit)
self.add_copy_spec_limit("/var/log/cups/page_log", sizelimit=limit)
else:
self.add_copy_spec("/var/log/cups")
diff --git a/sos/plugins/devicemapper.py b/sos/plugins/devicemapper.py
index fcd55a74..96e1a2c7 100644
--- a/sos/plugins/devicemapper.py
+++ b/sos/plugins/devicemapper.py
@@ -1,20 +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.
-import os
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class DeviceMapper(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""device-mapper related information
"""
diff --git a/sos/plugins/dhcp.py b/sos/plugins/dhcp.py
index 48d1a641..6eb5817b 100644
--- a/sos/plugins/dhcp.py
+++ b/sos/plugins/dhcp.py
@@ -1,25 +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, UbuntuPlugin
+
class Dhcp(Plugin):
"""DHCP related information
"""
plugin_name = "dhcp"
+
class RedHatDhcp(Dhcp, RedHatPlugin):
"""DHCP related information for Red Hat based distributions"""
@@ -33,6 +35,7 @@ class RedHatDhcp(Dhcp, RedHatPlugin):
"/etc/dhcp"
])
+
class UbuntuDhcp(Dhcp, UbuntuPlugin):
"""DHCP related information for Debian based distributions"""
@@ -40,7 +43,7 @@ class UbuntuDhcp(Dhcp, UbuntuPlugin):
packages = ('udhcpd',)
def setup(self):
- super(DebianDhcp, self).setup()
+ super(UbuntuDhcp, self).setup()
self.add_copy_specs([
"/etc/default/udhcpd",
"/etc/udhcpd.conf"
diff --git a/sos/plugins/distupgrade.py b/sos/plugins/distupgrade.py
index a98d3713..eeba0ed2 100644
--- a/sos/plugins/distupgrade.py
+++ b/sos/plugins/distupgrade.py
@@ -1,22 +1,22 @@
-## Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
+# Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
-### 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
from sos.plugins import Plugin, RedHatPlugin
+
class DistUpgrade(Plugin):
""" Distribution upgrade data """
diff --git a/sos/plugins/dmraid.py b/sos/plugins/dmraid.py
index e237e9ad..3f4ebaec 100644
--- a/sos/plugins/dmraid.py
+++ b/sos/plugins/dmraid.py
@@ -1,20 +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.
-import os
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class Dmraid(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""dmraid related information
"""
@@ -31,7 +31,7 @@ class Dmraid(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
# t - [-t|--test]
# a - {-a|--activate} {y|n|yes|no}
# D - [-D|--dump_metadata]
- dmraid_options = ['V','b','r','s','tay']
+ dmraid_options = ['V', 'b', 'r', 's', 'tay']
def setup(self):
for opt in self.dmraid_options:
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
index 38225d1c..caf13c63 100644
--- a/sos/plugins/docker.py
+++ b/sos/plugins/docker.py
@@ -1,20 +1,21 @@
-## Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
+# 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 Docker(Plugin, RedHatPlugin):
"""Docker information
"""
@@ -33,6 +34,7 @@ class Docker(Plugin, RedHatPlugin):
"docker images"
])
+
class RedHatDocker(Plugin, RedHatPlugin):
packages = ('docker-io',)
diff --git a/sos/plugins/dovecot.py b/sos/plugins/dovecot.py
index 37e504be..ee2cb901 100644
--- a/sos/plugins/dovecot.py
+++ b/sos/plugins/dovecot.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 Dovecot(Plugin):
"""dovecot server related information
@@ -25,6 +25,7 @@ class Dovecot(Plugin):
self.add_copy_spec("/etc/dovecot*")
self.add_cmd_output("dovecot -n")
+
class RedHatDovecot(Dovecot, RedHatPlugin):
"""dovecot server related information for RedHat based distribution
"""
@@ -34,6 +35,7 @@ class RedHatDovecot(Dovecot, RedHatPlugin):
packages = ('dovecot', )
files = ('/etc/dovecot.conf',)
+
class DebianDovecot(Dovecot, DebianPlugin, UbuntuPlugin):
"""dovecot server related information for Debian based distribution
"""
diff --git a/sos/plugins/dpkg.py b/sos/plugins/dpkg.py
index 266b2ee5..ad836410 100644
--- a/sos/plugins/dpkg.py
+++ b/sos/plugins/dpkg.py
@@ -1,20 +1,21 @@
-## Copyright (c) 2012 Adam Stokes <adam.stokes@canonical.com>
-## 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 <adam.stokes@canonical.com>
+# 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 Dpkg(Plugin, DebianPlugin, UbuntuPlugin):
"""dpkg information
"""
@@ -23,6 +24,6 @@ class Dpkg(Plugin, DebianPlugin, UbuntuPlugin):
def setup(self):
self.add_copy_spec("/var/log/dpkg.log")
- self.add_cmd_output("dpkg -l", root_symlink = "installed-debs")
+ self.add_cmd_output("dpkg -l", root_symlink="installed-debs")
# vim: et ts=4 sw=4
diff --git a/sos/plugins/ds.py b/sos/plugins/ds.py
index a79320ef..26079f77 100644
--- a/sos/plugins/ds.py
+++ b/sos/plugins/ds.py
@@ -1,23 +1,24 @@
-## Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
-## Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
+# Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
+# Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
-## 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 DirectoryServer(Plugin, RedHatPlugin):
"""Directory Server information
"""
@@ -29,10 +30,10 @@ class DirectoryServer(Plugin, RedHatPlugin):
def check_version(self):
if self.is_installed("redhat-ds-base") or \
- os.path.exists("/etc/dirsrv"):
+ os.path.exists("/etc/dirsrv"):
return "ds8"
elif self.is_installed("redhat-ds-7") or \
- os.path.exists("/opt/redhat-ds"):
+ os.path.exists("/opt/redhat-ds"):
return "ds7"
return False
@@ -51,7 +52,6 @@ class DirectoryServer(Plugin, RedHatPlugin):
self.add_cmd_output("certutil -L -d %s" % certpath)
except:
self.log_warn("could not list /etc/dirsrv")
-
if not self.check_version():
self.add_alert("Directory Server not found.")
diff --git a/sos/plugins/emc.py b/sos/plugins/emc.py
index ed827a79..e220ad7a 100644
--- a/sos/plugins/emc.py
+++ b/sos/plugins/emc.py
@@ -1,28 +1,29 @@
-## emc.py
-## Captures EMC specific information during a sos run.
+# Copyright (C) 2008 EMC Corporation. Keith Kearnan <kearnan_keith@emc.com>
-## Copyright (C) 2008 EMC Corporation. Keith Kearnan <kearnan_keith@emc.com>
+# 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
-### 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
+# 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.
+""" Captures EMC specific information during a sos run. """
from sos.plugins import Plugin, RedHatPlugin, os
# Just for completeness sake.
from six.moves import input
+
class Emc(Plugin, RedHatPlugin):
- """EMC related information (PowerPath, Solutions Enabler CLI and Navisphere CLI)
+ """ EMC related information (PowerPath, Solutions Enabler
+ CLI and Navisphere CLI)
"""
plugin_name = 'emc'
@@ -30,13 +31,26 @@ class Emc(Plugin, RedHatPlugin):
def about_emc(self):
""" EMC Corporation specific information
"""
- self.add_custom_text('<center><h1><font size="+4"color="blue">EMC&sup2;</font><font size="-2" color="blue">&reg;</font>')
- self.add_custom_text('<br><font size="+1">where information lives</font><font size="-2">&reg;</font></h1>')
- self.add_custom_text("EMC Corporation is the world's leading developer and provider of information ")
- self.add_custom_text("infrastructure technology and solutions that enable organizations of all sizes to transform ")
- self.add_custom_text("the way they compete and create value from their information. &nbsp;")
- self.add_custom_text("Information about EMC's products and services can be found at ")
- self.add_custom_text('<a href="http://www.EMC.com/">www.EMC.com</a>.</center>')
+ self.add_custom_text(
+ '<center><h1><font size="+4"color="blue">'
+ 'EMC&sup2;</font><font size="-2" color="blue">&reg;</font>')
+ self.add_custom_text(
+ '<br><font size="+1">where information lives</font>'
+ '<font size="-2">&reg;</font></h1>')
+ self.add_custom_text(
+ "EMC Corporation is the world's leading developer and provider "
+ "of information ")
+ self.add_custom_text(
+ "infrastructure technology and solutions that "
+ "enable organizations of all sizes to transform ")
+ self.add_custom_text(
+ "the way they compete and create value from their "
+ "information. &nbsp;")
+ self.add_custom_text(
+ "Information about EMC's products and services "
+ "can be found at ")
+ self.add_custom_text(
+ '<a href="http://www.EMC.com/">www.EMC.com</a>.</center>')
def get_pp_files(self):
""" EMC PowerPath specific information - files
@@ -77,7 +91,8 @@ class Emc(Plugin, RedHatPlugin):
])
def get_symcli_config(self):
- """ EMC Solutions Enabler SYMCLI specific information - Symmetrix/DMX - commands
+ """ EMC Solutions Enabler SYMCLI specific information
+ - Symmetrix/DMX - commands
"""
self.add_cmd_outputs([
"symclisymcli -def",
@@ -138,8 +153,9 @@ class Emc(Plugin, RedHatPlugin):
"/etc/Navisphere/log/[a-z]*"
])
- def get_navicli_SP_info(self,SP_address):
- """ EMC Navisphere Host Agent NAVICLI specific information - CLARiiON - commands
+ def get_navicli_SP_info(self, SP_address):
+ """ EMC Navisphere Host Agent NAVICLI specific
+ information - CLARiiON - commands
"""
self.add_cmd_outputs([
"navicli -h %s getall" % SP_address,
@@ -149,7 +165,8 @@ class Emc(Plugin, RedHatPlugin):
"navicli -h %s getdisk" % SP_address,
"navicli -h %s getcache" % SP_address,
"navicli -h %s getlun" % SP_address,
- "navicli -h %s getlun -rg -type -default -owner -crus -capacity" % SP_address,
+ "navicli -h %s getlun -rg -type -default -owner -crus "
+ "-capacity" % SP_address,
"navicli -h %s lunmapinfo" % SP_address,
"navicli -h %s getcrus" % SP_address,
"navicli -h %s port -list -all" % SP_address,
@@ -158,16 +175,16 @@ class Emc(Plugin, RedHatPlugin):
])
def check_enabled(self):
- self.packages = [ "EMCpower" ]
- self.files = [ "/opt/Navisphere/bin", "/proc/emcp" ]
+ self.packages = ["EMCpower"]
+ self.files = ["/opt/Navisphere/bin", "/proc/emcp"]
return Plugin.check_enabled(self)
def setup(self):
from subprocess import Popen, PIPE
- ## About EMC Corporation default no if no EMC products are installed
- add_about_emc="no"
+ # About EMC Corporation default no if no EMC products are installed
+ add_about_emc = "no"
- ## If PowerPath is installed collect PowerPath specific information
+ # If PowerPath is installed collect PowerPath specific information
if self.is_installed("EMCpower"):
print("EMC PowerPath is installed.")
print(" Gathering EMC PowerPath information...")
@@ -175,14 +192,17 @@ class Emc(Plugin, RedHatPlugin):
self.get_pp_files()
add_about_emc = "yes"
- ## If PowerPath is running collect additional PowerPath specific information
+ # If PowerPath is running collect additional PowerPath specific
+ # information
if os.path.isdir("/proc/emcp"):
print("EMC PowerPath is running.")
print(" Gathering additional EMC PowerPath information...")
self.get_pp_config()
- ## If Solutions Enabler is installed collect Symmetrix/DMX specific information
- if len(self.policy().package_manager.all_pkgs_by_name_regex('[Ss][Yy][Mm][Cc][Ll][Ii]-[Ss][Yy][Mm][Cc][Ll][Ii]')) > 0:
+ # If Solutions Enabler is installed collect Symmetrix/DMX specific
+ # information
+ if len(self.policy().package_manager.all_pkgs_by_name_regex(
+ '[Ss][Yy][Mm][Cc][Ll][Ii]-[Ss][Yy][Mm][Cc][Ll][Ii]')) > 0:
print("EMC Solutions Enabler SYMCLI is installed.")
print(" Gathering EMC Solutions Enabler SYMCLI information...")
self.add_custom_text("EMC Solutions Enabler is installed.<br>")
@@ -190,16 +210,20 @@ class Emc(Plugin, RedHatPlugin):
self.get_symcli_config()
add_about_emc = "yes"
- ## If Navisphere Host Agent is installed collect CLARiiON specific information
+ # If Navisphere Host Agent is installed collect CLARiiON specific
+ # information
if os.path.isdir("/opt/Navisphere/bin"):
print("")
print("The EMC CLARiiON Navisphere Host Agent is installed.")
- self.add_custom_text("EMC CLARiiON Navisphere Host Agent is installed.<br>")
+ self.add_custom_text("EMC CLARiiON Navisphere Host Agent is "
+ "installed.<br>")
self.get_navicli_config()
print(" Gathering Navisphere NAVICLI Host Agent information...")
- print(" Please enter a CLARiiON SP IP address. In order to collect")
- print( " information for both SPA and SPB as well as multiple")
- print(" CLARiiON arrays (if desired) you will be prompted multiple times.")
+ print(" Please enter a CLARiiON SP IP address. In order to "
+ "collect")
+ print(" information for both SPA and SPB as well as multiple")
+ print(" CLARiiON arrays (if desired) you will be prompted "
+ "multiple times.")
print(" To exit simply press [Enter]")
print("")
add_about_emc = "yes"
@@ -207,28 +231,32 @@ class Emc(Plugin, RedHatPlugin):
CLARiiON_IP_loop = "stay_in"
while CLARiiON_IP_loop == "stay_in":
ans = input("CLARiiON SP IP Address or [Enter] to exit: ")
- ## Check to make sure the CLARiiON SP IP address provided is valid
+ # Check to make sure the CLARiiON SP IP address provided is
+ # valid
p = Popen("navicli -h %s getsptime" % (ans,),
- shell=True, stdout=PIPE, stderr=PIPE, close_fds=True)
+ shell=True, stdout=PIPE, stderr=PIPE,
+ close_fds=True)
out, err = p.communicate()
if p.returncode == 0:
CLARiiON_IP_address_list.append(ans)
else:
if ans != "":
- print("The IP address you entered, %s, is not to an active CLARiiON SP." % ans)
+ print("The IP address you entered, %s, is not to an "
+ "active CLARiiON SP." % ans)
if ans == "":
CLARiiON_IP_loop = "get_out"
- ## Sort and dedup the list of CLARiiON IP Addresses
+ # Sort and dedup the list of CLARiiON IP Addresses
CLARiiON_IP_address_list.sort()
for SP_address in CLARiiON_IP_address_list:
if CLARiiON_IP_address_list.count(SP_address) > 1:
CLARiiON_IP_address_list.remove(SP_address)
for SP_address in CLARiiON_IP_address_list:
if SP_address != "":
- print(" Gathering NAVICLI information for %s..." % SP_address)
+ print(" Gathering NAVICLI information for %s..." %
+ SP_address)
self.get_navicli_SP_info(SP_address)
- ## Only provide About EMC if EMC products are installed
+ # Only provide About EMC if EMC products are installed
if add_about_emc != "no":
self.about_emc()
diff --git a/sos/plugins/filesys.py b/sos/plugins/filesys.py
index 97795567..8681f7b1 100644
--- a/sos/plugins/filesys.py
+++ b/sos/plugins/filesys.py
@@ -1,21 +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
-import re
-from six.moves import zip
+
class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""information on filesystems
@@ -23,7 +21,8 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
plugin_name = 'filesys'
- option_list = [("lsof", 'gathers information on all open files', 'slow', False),
+ option_list = [("lsof", 'gathers information on all open files', 'slow',
+ False),
("dumpe2fs", 'dump filesystem information', 'slow', False)]
def setup(self):
@@ -35,15 +34,15 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"/proc/self/mountstats",
"/proc/mounts"
])
- self.add_cmd_output("mount -l", root_symlink = "mount")
- self.add_cmd_output("df -al", root_symlink = "df")
+ self.add_cmd_output("mount -l", root_symlink="mount")
+ self.add_cmd_output("df -al", root_symlink="df")
self.add_cmd_outputs([
"df -ali",
"findmnt"
])
if self.get_option('lsof'):
- self.add_cmd_output("lsof -b +M -n -l -P", root_symlink = "lsof")
+ self.add_cmd_output("lsof -b +M -n -l -P", root_symlink="lsof")
dumpe2fs_opts = '-h'
if self.get_option('dumpe2fs'):
diff --git a/sos/plugins/firewalld.py b/sos/plugins/firewalld.py
index 5bd1a5cb..50eb1a97 100644
--- a/sos/plugins/firewalld.py
+++ b/sos/plugins/firewalld.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2014 Red Hat, Inc. Jamie Bainbridge <jbainbri@redhat.com>
-## Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc. Jamie Bainbridge <jbainbri@redhat.com>
+# Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
+# 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
+
class FirewallD(Plugin, RedHatPlugin):
"""FirewallD information
"""
diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py
index 773efeeb..d5c6b23e 100644
--- a/sos/plugins/foreman.py
+++ b/sos/plugins/foreman.py
@@ -1,22 +1,22 @@
-## Copyright (C) 2013 Red Hat, Inc., Lukas Zapletal <lzap@redhat.com>
+# Copyright (C) 2013 Red Hat, Inc., Lukas Zapletal <lzap@redhat.com>
-## 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
from sos.plugins import Plugin, RedHatPlugin
+
class Foreman(Plugin, RedHatPlugin):
"""Foreman project related information
"""
diff --git a/sos/plugins/gdm.py b/sos/plugins/gdm.py
index 38638139..208b45c1 100644
--- a/sos/plugins/gdm.py
+++ b/sos/plugins/gdm.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 Gdm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""gdm related information
"""
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index 14fa54d6..36f81336 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.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
-import os
-from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
class General(Plugin):
"""basic system information"""
@@ -23,7 +23,7 @@ class General(Plugin):
def setup(self):
self.add_copy_specs([
"/etc/init", # upstart
- "/etc/event.d", # "
+ "/etc/event.d",
"/etc/inittab",
"/etc/sos.conf",
"/etc/sysconfig",
@@ -58,10 +58,9 @@ class RedHatGeneral(General, RedHatPlugin):
"/etc/fedora-release"
])
-
def postproc(self):
self.do_file_sub("/etc/sysconfig/rhn/up2date",
- r"(\s*proxyPassword\s*=\s*)\S+", r"\1***")
+ r"(\s*proxyPassword\s*=\s*)\S+", r"\1***")
class DebianGeneral(General, DebianPlugin):
diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py
index 487723ad..d9a7fb8c 100644
--- a/sos/plugins/gluster.py
+++ b/sos/plugins/gluster.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.
import time
import os.path
@@ -18,6 +18,7 @@ import os
import string
from sos.plugins import Plugin, RedHatPlugin
+
class Gluster(Plugin, RedHatPlugin):
'''gluster related information'''
@@ -34,7 +35,7 @@ class Gluster(Plugin, RedHatPlugin):
"""Return a dictionary for which key are volume names according to the
output of gluster volume info stored in volume_file.
"""
- out=[]
+ out = []
fp = open(volume_file, 'r')
for line in fp.readlines():
if not line.startswith("Volume Name:"):
@@ -46,34 +47,35 @@ class Gluster(Plugin, RedHatPlugin):
def make_preparations(self, name_dir):
try:
- os.mkdir(name_dir);
+ os.mkdir(name_dir)
except:
pass
- fp = open ('/tmp/glusterdump.options', 'w');
- data = 'path=' + name_dir + '\n';
- fp.write(data);
- fp.write('all=yes');
- fp.close();
+ fp = open('/tmp/glusterdump.options', 'w')
+ data = 'path=' + name_dir + '\n'
+ fp.write(data)
+ fp.write('all=yes')
+ fp.close()
def wait_for_statedump(self, name_dir):
- statedumps_present = 0;
- statedump_entries = os.listdir(name_dir);
+ statedumps_present = 0
+ statedump_entries = os.listdir(name_dir)
for statedump_file in statedump_entries:
- statedumps_present = statedumps_present+1;
- last_line = 'tmp';
- ret = -1;
- while ret == -1:
- last_line = file(name_dir + '/' + statedump_file, "r").readlines()[-1];
- ret = string.count (last_line, 'DUMP_END_TIME');
+ statedumps_present = statedumps_present+1
+ last_line = 'tmp'
+ ret = -1
+ while ret == -1:
+ last_line = file(
+ name_dir + '/' + statedump_file, "r").readlines()[-1]
+ ret = string.count(last_line, 'DUMP_END_TIME')
def postproc(self):
if not os.path.exists(self.statedump_dir):
return
try:
for dirs in os.listdir(self.statedump_dir):
- os.remove(os.path.join(self.statedump_dir,dirs));
- os.rmdir(self.statedump_dir);
- os.unlink('/tmp/glusterdump.options');
+ os.remove(os.path.join(self.statedump_dir, dirs))
+ os.rmdir(self.statedump_dir)
+ os.unlink('/tmp/glusterdump.options')
except:
pass
diff --git a/sos/plugins/grub.py b/sos/plugins/grub.py
index 926439f6..b439e889 100644
--- a/sos/plugins/grub.py
+++ b/sos/plugins/grub.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 Grub(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Grub information
"""
diff --git a/sos/plugins/grub2.py b/sos/plugins/grub2.py
index 45e9d8ed..6e2e1b4d 100644
--- a/sos/plugins/grub2.py
+++ b/sos/plugins/grub2.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 Grub2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Bootloader information
"""
@@ -39,9 +40,9 @@ class Grub2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def postproc(self):
# the trailing space is required; python treats '_' as whitespace
# causing the passwd_exp to match pbkdf2 passwords and mangle them.
- passwd_exp = r"(password )\s*(\S*)\s*(\S*)"
+ passwd_exp = r"(password )\s*(\S*)\s*(\S*)"
passwd_pbkdf2_exp = r"(password_pbkdf2)\s*(\S*)\s*(\S*)"
- passwd_sub = r"\1 \2 ********"
+ passwd_sub = r"\1 \2 ********"
passwd_pbkdf2_sub = r"\1 \2 grub.pbkdf2.********"
self.do_cmd_output_sub(
diff --git a/sos/plugins/haproxy.py b/sos/plugins/haproxy.py
index 525f211a..e1015f27 100644
--- a/sos/plugins/haproxy.py
+++ b/sos/plugins/haproxy.py
@@ -1,20 +1,21 @@
-## Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
+# 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 HAProxy(Plugin, RedHatPlugin):
"""HAProxy information
"""
diff --git a/sos/plugins/hardware.py b/sos/plugins/hardware.py
index d36b6cdd..58ca7ec9 100644
--- a/sos/plugins/hardware.py
+++ b/sos/plugins/hardware.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 Hardware(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""hardware related information
@@ -32,7 +31,7 @@ class Hardware(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"/var/log/mcelog"
])
- self.add_cmd_output("dmidecode", root_symlink = "dmidecode")
-
+ self.add_cmd_output("dmidecode", root_symlink="dmidecode")
+
# vim: et ts=4 sw=4
diff --git a/sos/plugins/hpasm.py b/sos/plugins/hpasm.py
index 4d5ed7d1..5b16e5ab 100644
--- a/sos/plugins/hpasm.py
+++ b/sos/plugins/hpasm.py
@@ -1,20 +1,21 @@
-## Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
+# 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 Hpasm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""HP ASM (hp Server Management Drivers and Agent) information
"""
diff --git a/sos/plugins/hts.py b/sos/plugins/hts.py
index 684e8c0f..2cefd733 100644
--- a/sos/plugins/hts.py
+++ b/sos/plugins/hts.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 HardwareTestSuite(Plugin, RedHatPlugin):
"""Red Hat Hardware Test Suite related information
"""
diff --git a/sos/plugins/i18n.py b/sos/plugins/i18n.py
index 90a20981..e60f5b37 100644
--- a/sos/plugins/i18n.py
+++ b/sos/plugins/i18n.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 I18n(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Internationalization related information
"""
diff --git a/sos/plugins/infiniband.py b/sos/plugins/infiniband.py
index 60329100..cef1172b 100644
--- a/sos/plugins/infiniband.py
+++ b/sos/plugins/infiniband.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2011, 2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
+# Copyright (C) 2011, 2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
-### 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 Infiniband(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Infiniband related information
"""
diff --git a/sos/plugins/ipa.py b/sos/plugins/ipa.py
index 7bfe7163..10ccd891 100644
--- a/sos/plugins/ipa.py
+++ b/sos/plugins/ipa.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
+# Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
-## 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 Ipa(Plugin, RedHatPlugin):
"""IPA diagnostic information
"""
diff --git a/sos/plugins/ipsec.py b/sos/plugins/ipsec.py
index 032a7b8f..e4439de8 100644
--- a/sos/plugins/ipsec.py
+++ b/sos/plugins/ipsec.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
+# Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
-### 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 IPSec(Plugin):
"""ipsec related information
"""
@@ -23,6 +24,7 @@ class IPSec(Plugin):
plugin_name = "ipsec"
packages = ('ipsec-tools',)
+
class RedHatIpsec(IPSec, RedHatPlugin):
"""ipsec related information for Red Hat distributions
"""
@@ -32,6 +34,7 @@ class RedHatIpsec(IPSec, RedHatPlugin):
def setup(self):
self.add_copy_spec("/etc/racoon")
+
class DebianIPSec(IPSec, DebianPlugin, UbuntuPlugin):
"""ipsec related information for Debian distributions
"""
diff --git a/sos/plugins/ipvs.py b/sos/plugins/ipvs.py
index f311eb32..fb67d099 100644
--- a/sos/plugins/ipvs.py
+++ b/sos/plugins/ipvs.py
@@ -1,20 +1,21 @@
-## Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
+# 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
+
class Ipvs(Plugin, RedHatPlugin, DebianPlugin):
"""Ipvs information
"""
diff --git a/sos/plugins/iscsi.py b/sos/plugins/iscsi.py
index 2529b07e..5abb3437 100644
--- a/sos/plugins/iscsi.py
+++ b/sos/plugins/iscsi.py
@@ -1,26 +1,28 @@
-## Copyright (C) 2007-2012 Red Hat, Inc., Ben Turner <bturner@redhat.com>
-### 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., Ben Turner <bturner@redhat.com>
+# 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 Iscsi(Plugin):
"""iscsi-initiator related information
"""
plugin_name = "iscsi"
+
class RedHatIscsi(Iscsi, RedHatPlugin):
"""iscsi-initiator related information Red Hat based distributions
"""
diff --git a/sos/plugins/iscsitarget.py b/sos/plugins/iscsitarget.py
index 173828fa..3818ff8c 100644
--- a/sos/plugins/iscsitarget.py
+++ b/sos/plugins/iscsitarget.py
@@ -1,28 +1,30 @@
-## Copyright (C) 2007-2012 Red Hat, Inc., Ben Turner <bturner@redhat.com>
-## Copyright (C) 2012 Adam Stokes <adam.stokes@canonical.com>
+# Copyright (C) 2007-2012 Red Hat, Inc., Ben Turner <bturner@redhat.com>
+# Copyright (C) 2012 Adam Stokes <adam.stokes@canonical.com>
-### 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 IscsiTarget(Plugin):
"""iscsi-target related information
"""
plugin_name = "iscsitarget"
+
class RedHatIscsiTarget(IscsiTarget, RedHatPlugin):
"""iscsi-target related information for Red Hat distributions
"""
@@ -34,6 +36,7 @@ class RedHatIscsiTarget(IscsiTarget, RedHatPlugin):
self.add_copy_spec("/etc/tgt/targets.conf")
self.add_cmd_output("tgtadm --lld iscsi --op show --mode target")
+
class DebianIscsiTarget(IscsiTarget, DebianPlugin, UbuntuPlugin):
"""iscsi-target related information for Debian based distributions
"""
diff --git a/sos/plugins/java.py b/sos/plugins/java.py
index d316bc10..9fa69b80 100644
--- a/sos/plugins/java.py
+++ b/sos/plugins/java.py
@@ -1,20 +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.
-import os
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
+
class Java(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
"""basic java information"""
@@ -24,7 +24,7 @@ class Java(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
self.add_copy_spec("/etc/java")
self.add_forbidden_path("/etc/java/security")
self.add_cmd_output("alternatives --display java",
- root_symlink="java")
+ root_symlink="java")
self.add_cmd_output("readlink -f /usr/bin/java")
diff --git a/sos/plugins/juju.py b/sos/plugins/juju.py
index ad702d5b..cbaa6614 100644
--- a/sos/plugins/juju.py
+++ b/sos/plugins/juju.py
@@ -16,6 +16,7 @@
from sos.plugins import Plugin, UbuntuPlugin
+
class Juju(Plugin, UbuntuPlugin):
""" Juju Plugin
"""
diff --git a/sos/plugins/katello.py b/sos/plugins/katello.py
index 6fd0fb7e..8d1fcedf 100644
--- a/sos/plugins/katello.py
+++ b/sos/plugins/katello.py
@@ -1,22 +1,22 @@
-## Copyright (C) 2013 Red Hat, Inc., Lukas Zapletal <lzap@redhat.com>
+# Copyright (C) 2013 Red Hat, Inc., Lukas Zapletal <lzap@redhat.com>
-## 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
from sos.plugins import Plugin, RedHatPlugin
+
class Katello(Plugin, RedHatPlugin):
"""Katello project related information
"""
diff --git a/sos/plugins/kdump.py b/sos/plugins/kdump.py
index 460d69e0..0d324296 100644
--- a/sos/plugins/kdump.py
+++ b/sos/plugins/kdump.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 KDump(Plugin):
"""Kdump related information
"""
@@ -25,6 +26,7 @@ class KDump(Plugin):
"/proc/cmdline"
])
+
class RedHatKDump(KDump, RedHatPlugin):
"""Kdump related information for Red Hat distributions
"""
@@ -39,6 +41,7 @@ class RedHatKDump(KDump, RedHatPlugin):
"/var/crash/*/vmcore-dmesg.txt"
])
+
class DebianKDump(KDump, DebianPlugin, UbuntuPlugin):
"""Kdump related information for Debian distributions
"""
diff --git a/sos/plugins/keepalived.py b/sos/plugins/keepalived.py
index 05aae47e..46820107 100644
--- a/sos/plugins/keepalived.py
+++ b/sos/plugins/keepalived.py
@@ -1,20 +1,21 @@
-## Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
-### 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) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com>
+# 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 Keepalived(Plugin, RedHatPlugin):
"""Keepalived information
"""
diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py
index d94faba5..18e7a057 100644
--- a/sos/plugins/kernel.py
+++ b/sos/plugins/kernel.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 Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""kernel related information
"""
@@ -25,8 +26,8 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def setup(self):
# compat
- self.add_cmd_output("uname -a", root_symlink = "uname")
- self.add_cmd_output("lsmod", root_symlink = "lsmod")
+ self.add_cmd_output("uname -a", root_symlink="uname")
+ self.add_cmd_output("lsmod", root_symlink="lsmod")
try:
modules = os.listdir(self.sys_module)
diff --git a/sos/plugins/kernelrt.py b/sos/plugins/kernelrt.py
index 2a205fc8..2b6856bb 100644
--- a/sos/plugins/kernelrt.py
+++ b/sos/plugins/kernelrt.py
@@ -16,6 +16,7 @@
from sos.plugins import Plugin, RedHatPlugin
+
class KernelRT(Plugin, RedHatPlugin):
'''Information specific to the realtime kernel
'''
@@ -32,11 +33,13 @@ class KernelRT(Plugin, RedHatPlugin):
'/proc/sys/kernel/sched_rt_period_us',
'/proc/sys/kernel/sched_rt_runtime_us',
'/sys/kernel/realtime',
- '/sys/devices/system/clocksource/clocksource0/available_clocksource',
+ '/sys/devices/system/clocksource/clocksource0/'
+ 'available_clocksource',
'/sys/devices/system/clocksource/clocksource0/current_clocksource'
])
- # note: rhbz#1059685 'tuna - NameError: global name 'cgroups' is not defined'
- # this command throws an exception on versions prior to 0.10.4-5.
+ # note: rhbz#1059685 'tuna - NameError: global name 'cgroups' is not
+ # defined this command throws an exception on versions prior to
+ # 0.10.4-5.
self.add_cmd_output('tuna -CP')
# vim: et ts=4 sw=4
diff --git a/sos/plugins/krb5.py b/sos/plugins/krb5.py
index 78a8c6a5..202dd37a 100644
--- a/sos/plugins/krb5.py
+++ b/sos/plugins/krb5.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2013 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
+# Copyright (C) 2013 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
-### 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 Krb5(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Kerberos related information
"""
diff --git a/sos/plugins/kvm.py b/sos/plugins/kvm.py
index c7d34790..796527ac 100644
--- a/sos/plugins/kvm.py
+++ b/sos/plugins/kvm.py
@@ -1,23 +1,24 @@
-## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
-### 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 Kvm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""KVM related information
"""
@@ -40,7 +41,7 @@ class Kvm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
if not os.path.ismount(self.debugfs_path):
self._debugfs_cleanup = True
r = self.call_ext_prog("mount -t debugfs debugfs %s"
- % self.debugfs_path)
+ % self.debugfs_path)
if r['status'] != 0:
self.log_error("debugfs not mounted and mount attempt failed")
self._debugfs_cleanup = False
@@ -49,7 +50,7 @@ class Kvm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def postproc(self):
if self._debugfs_cleanup and os.path.ismount(self.debugfs_path):
- r = self.call_ext_prog("umount %s" % self.debugfs_path)
+ self.call_ext_prog("umount %s" % self.debugfs_path)
self.log_error("could not unmount %s" % self.debugfs_path)
# vim: et ts=4 sw=4
diff --git a/sos/plugins/landscape.py b/sos/plugins/landscape.py
index f0d1fe91..606a3226 100644
--- a/sos/plugins/landscape.py
+++ b/sos/plugins/landscape.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, UbuntuPlugin
+
class Landscape(Plugin, UbuntuPlugin):
"""
landscape client related information
@@ -28,11 +29,11 @@ class Landscape(Plugin, UbuntuPlugin):
def setup(self):
self.add_copy_spec("/etc/landscape/client.conf")
-
+
def postproc(self):
self.do_file_sub(
- "/etc/landscape/client.conf",
- r"registration_password(.*)",
+ "/etc/landscape/client.conf",
+ r"registration_password(.*)",
r"registration_password[********]"
)
diff --git a/sos/plugins/ldap.py b/sos/plugins/ldap.py
index d086fd06..fddc9282 100644
--- a/sos/plugins/ldap.py
+++ b/sos/plugins/ldap.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 Ldap(Plugin):
"""LDAP related information
@@ -29,6 +29,7 @@ class Ldap(Plugin):
def postproc(self):
self.do_file_sub("/etc/ldap.conf", r"(\s*bindpw\s*)\S+", r"\1******")
+
class RedHatLdap(Ldap, RedHatPlugin):
"""LDAP related information for RedHat based distribution
"""
@@ -44,11 +45,11 @@ class RedHatLdap(Ldap, RedHatPlugin):
self.add_forbidden_path("/etc/openldap/certs/*passw*")
self.add_forbidden_path("/etc/openldap/certs/key3.db")
self.add_copy_specs([
- ldap_conf,
- "/etc/openldap/certs/cert8.db",
- "/etc/openldap/certs/secmod.db",
- "/etc/nslcd.conf",
- "/etc/pam_ldap.conf"
+ self.ldap_conf,
+ "/etc/openldap/certs/cert8.db",
+ "/etc/openldap/certs/secmod.db",
+ "/etc/nslcd.conf",
+ "/etc/pam_ldap.conf"
])
self.add_cmd_output("certutil -L -d /etc/openldap")
@@ -65,6 +66,7 @@ class RedHatLdap(Ldap, RedHatPlugin):
r"\1********"
)
+
class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin):
"""LDAP related information for Debian based distribution
"""
@@ -84,11 +86,14 @@ class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin):
])
self.add_cmd_output("ldapsearch -x -b '' -s base 'objectclass=*'")
- self.add_cmd_output(ldap_search + "-b cn=config '(!(objectClass=olcSchemaConfig))'",
+ self.add_cmd_output(
+ ldap_search + "-b cn=config '(!(objectClass=olcSchemaConfig))'",
suggest_filename="configuration_minus_schemas")
- self.add_cmd_output(ldap_search + "-b cn=schema,cn=config dn",
+ self.add_cmd_output(
+ ldap_search + "-b cn=schema,cn=config dn",
suggest_filename="loaded_schemas")
- self.add_cmd_output(ldap_search + "-b cn=config '(olcAccess=*)' olcAccess olcSuffix",
+ self.add_cmd_output(
+ ldap_search + "-b cn=config '(olcAccess=*)' olcAccess olcSuffix",
suggest_filename="access_control_lists")
def postproc(self):
diff --git a/sos/plugins/libraries.py b/sos/plugins/libraries.py
index 95cdf20e..c166fa6f 100644
--- a/sos/plugins/libraries.py
+++ b/sos/plugins/libraries.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, UbuntuPlugin
+
class Libraries(Plugin, RedHatPlugin, UbuntuPlugin):
"""information on shared libraries
"""
diff --git a/sos/plugins/libvirt.py b/sos/plugins/libvirt.py
index f424d3e8..ddfb0ba8 100644
--- a/sos/plugins/libvirt.py
+++ b/sos/plugins/libvirt.py
@@ -1,21 +1,22 @@
-### 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
import glob
import os
+
class Libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
"""libvirt-related information
"""
@@ -44,8 +45,10 @@ class Libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
])
if not self.get_option("all_logs"):
- self.add_copy_spec_limit("/var/log/libvirt/libvirtd.log", sizelimit=5)
- self.add_copy_spec_limit("/var/log/libvirt/qemu/*.log", sizelimit=5)
+ self.add_copy_spec_limit("/var/log/libvirt/libvirtd.log",
+ sizelimit=5)
+ self.add_copy_spec_limit("/var/log/libvirt/qemu/*.log",
+ sizelimit=5)
self.add_copy_spec_limit("/var/log/libvirt/lxc/*.log", sizelimit=5)
self.add_copy_spec_limit("/var/log/libvirt/uml/*.log", sizelimit=5)
else:
@@ -55,7 +58,7 @@ class Libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
self.add_cmd_output("klist -ket %s" % libvirt_keytab)
def postproc(self):
- for xmlfile in glob.glob("/etc/libvirt/qemu/*.xml"):
+ for xmlfile in glob.glob("/etc/libvirt/qemu/*.xml"):
self.do_file_sub(
xmlfile,
r"(\s*passwd=\s*')([^']*)('.*)",
diff --git a/sos/plugins/lilo.py b/sos/plugins/lilo.py
index 46c18149..2516daf2 100644
--- a/sos/plugins/lilo.py
+++ b/sos/plugins/lilo.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, UbuntuPlugin
+
class Lilo(Plugin, RedHatPlugin, UbuntuPlugin):
"""Lilo information
"""
diff --git a/sos/plugins/logrotate.py b/sos/plugins/logrotate.py
index 8497c3c7..d609d059 100644
--- a/sos/plugins/logrotate.py
+++ b/sos/plugins/logrotate.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 LogRotate(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""logrotate configuration files and debug info
"""
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py
index 3f0c5c28..47f0066f 100644
--- a/sos/plugins/logs.py
+++ b/sos/plugins/logs.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.
import os
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class Logs(Plugin):
"""log data """
@@ -27,20 +28,21 @@ class Logs(Plugin):
])
self.limit = self.get_option("log_size")
- self.add_copy_spec_limit("/var/log/boot.log", sizelimit = self.limit)
- self.add_copy_spec_limit("/var/log/cloud-init*", sizelimit = self.limit)
+ self.add_copy_spec_limit("/var/log/boot.log", sizelimit=self.limit)
+ self.add_copy_spec_limit("/var/log/cloud-init*", sizelimit=self.limit)
if self.get_option('all_logs'):
logs = self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+",
- "/etc/syslog.conf")
+ "/etc/syslog.conf")
if self.is_installed("rsyslog") \
- or os.path.exists("/etc/rsyslog.conf"):
- logs += self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+", "/etc/rsyslog.conf")
+ or os.path.exists("/etc/rsyslog.conf"):
+ logs += self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+",
+ "/etc/rsyslog.conf")
for i in logs:
if i.startswith("-"):
i = i[1:]
if os.path.isfile(i):
- self.add_copy_spec_limit(i, sizelimit = self.limit)
+ self.add_copy_spec_limit(i, sizelimit=self.limit)
class RedHatLogs(Logs, RedHatPlugin):
@@ -48,8 +50,8 @@ class RedHatLogs(Logs, RedHatPlugin):
def setup(self):
super(RedHatLogs, self).setup()
- self.add_copy_spec_limit("/var/log/secure*", sizelimit = self.limit)
- self.add_copy_spec_limit("/var/log/messages*", sizelimit = self.limit)
+ self.add_copy_spec_limit("/var/log/secure*", sizelimit=self.limit)
+ self.add_copy_spec_limit("/var/log/messages*", sizelimit=self.limit)
class DebianLogs(Logs, DebianPlugin, UbuntuPlugin):
diff --git a/sos/plugins/lsbrelease.py b/sos/plugins/lsbrelease.py
index 7a8ceed2..af9adee4 100644
--- a/sos/plugins/lsbrelease.py
+++ b/sos/plugins/lsbrelease.py
@@ -1,20 +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
-import os
+
class LsbRelease(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Linux Standard Base information
@@ -24,7 +24,9 @@ class LsbRelease(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def setup(self):
self.add_cmd_output("lsb_release -a")
- self.add_cmd_output("lsb_release -d", suggest_filename = "lsb_release", root_symlink = "lsb-release")
+ self.add_cmd_output(
+ "lsb_release -d", suggest_filename="lsb_release",
+ root_symlink="lsb-release")
self.add_copy_spec("/etc/lsb-release*")
# vim: et ts=4 sw=4
diff --git a/sos/plugins/lvm2.py b/sos/plugins/lvm2.py
index c54d54df..0b1fccbe 100644
--- a/sos/plugins/lvm2.py
+++ b/sos/plugins/lvm2.py
@@ -1,35 +1,36 @@
-### 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
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
- """lvm2 related information
+ """lvm2 related information
"""
plugin_name = 'lvm2'
option_list = [("lvmdump", 'collect an lvmdump tarball', 'fast', False),
- ("lvmdump-am", 'attempt to collect an lvmdump with advanced ' \
- + 'options and raw metadata collection', 'slow', False)]
+ ("lvmdump-am", 'attempt to collect an lvmdump with '
+ 'advanced options and raw metadata collection', 'slow',
+ False)]
def do_lvmdump(self, metadata=False):
"""Collects an lvmdump in standard format with optional metadata
archives for each physical volume present.
"""
- lvmdump_cmd = "lvmdump %s -d '%s'"
+ lvmdump_cmd = "lvmdump %s -d '%s'"
lvmdump_opts = ""
if metadata:
lvmdump_opts = "-a -m"
@@ -38,12 +39,13 @@ class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
self.add_cmd_output(cmd)
def setup(self):
- # use locking_type 0 (no locks) when running LVM2 commands, from lvm.conf:
- # Turn locking off by setting to 0 (dangerous: risks metadata corruption
- # if LVM2 commands get run concurrently).
- # None of the commands issued by sos ever modify metadata and this avoids
- # the possibility of hanging lvm commands when another process or node
- # holds a conflicting lock.
+ # use locking_type 0 (no locks) when running LVM2 commands,
+ # from lvm.conf:
+ # Turn locking off by setting to 0 (dangerous: risks metadata
+ # corruption if LVM2 commands get run concurrently).
+ # None of the commands issued by sos ever modify metadata and this
+ # avoids the possibility of hanging lvm commands when another process
+ # or node holds a conflicting lock.
lvm_opts = '--config="global{locking_type=0}"'
self.add_cmd_output(
diff --git a/sos/plugins/md.py b/sos/plugins/md.py
index 2f9e8efc..5ca3ab0c 100644
--- a/sos/plugins/md.py
+++ b/sos/plugins/md.py
@@ -1,20 +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.
-import os
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class Md(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""MD subsystem information
"""
@@ -28,6 +28,6 @@ class Md(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"/etc/mdadm.conf",
"/dev/md/md-device-map"
])
-
+
# vim: et ts=4 sw=4
diff --git a/sos/plugins/megacli.py b/sos/plugins/megacli.py
index 1630c486..0a83b9a1 100644
--- a/sos/plugins/megacli.py
+++ b/sos/plugins/megacli.py
@@ -1,24 +1,25 @@
-## megacli.py
-## Copyright (C) 2007-2014 Red Hat, Inc., Jon Magrini <jmagrini@redhat.com>
+# megacli.py
+# Copyright (C) 2007-2014 Red Hat, Inc., Jon Magrini <jmagrini@redhat.com>
-### 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 os.path
from sos.plugins import Plugin, RedHatPlugin
+
class MegaCLI(Plugin, RedHatPlugin):
"""Information for devices which use the MegaRAID Unified device driver
"""
@@ -33,11 +34,12 @@ class MegaCLI(Plugin, RedHatPlugin):
def get_megacli_files(self):
""" MegaCLI specific output
"""
+
self.add_cmd_outputs([
- megacli_cmd + " LDPDInfo -aALL",
- megacli_cmd + " -AdpAllInfo -aALL",
- megacli_cmd + " -AdpBbuCmd -GetBbuStatus -aALL",
- megacli_cmd + " -ShowSummary -a0"
+ "MegaCli64 LDPDInfo -aALL",
+ "MegaCli64 -AdpAllInfo -aALL",
+ "MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL",
+ "MegaCli64 -ShowSummary -a0"
])
# vim: et ts=4 sw=4
diff --git a/sos/plugins/memory.py b/sos/plugins/memory.py
index d828f68c..5b21fdb7 100644
--- a/sos/plugins/memory.py
+++ b/sos/plugins/memory.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 Memory(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""memory usage information
"""
@@ -27,7 +28,7 @@ class Memory(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"/proc/vmstat",
"/proc/slabinfo",
"/proc/pagetypeinfo"])
- self.add_cmd_output("free", root_symlink = "free")
+ self.add_cmd_output("free", root_symlink="free")
self.add_cmd_output("free -m")
# vim: et ts=4 sw=4
diff --git a/sos/plugins/mongodb.py b/sos/plugins/mongodb.py
index 70d5550a..05d37d3c 100644
--- a/sos/plugins/mongodb.py
+++ b/sos/plugins/mongodb.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
+# Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
-### 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 MongoDb(Plugin, DebianPlugin, UbuntuPlugin):
"""MongoDB related information
"""
@@ -38,6 +39,7 @@ class MongoDb(Plugin, DebianPlugin, UbuntuPlugin):
r"mms-token = ********"
)
+
class RedHatMongoDb(MongoDb, RedHatPlugin):
""" MongoDB related information for Red Hat distributions
"""
diff --git a/sos/plugins/mrggrid.py b/sos/plugins/mrggrid.py
index 19af171c..65bba8af 100644
--- a/sos/plugins/mrggrid.py
+++ b/sos/plugins/mrggrid.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 MrgGrid(Plugin, RedHatPlugin):
"""MRG GRID related information
"""
diff --git a/sos/plugins/mrgmessg.py b/sos/plugins/mrgmessg.py
index e1538531..4ee985c7 100644
--- a/sos/plugins/mrgmessg.py
+++ b/sos/plugins/mrgmessg.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 MrgMessg(Plugin, RedHatPlugin):
"""MRG Messaging related information
"""
diff --git a/sos/plugins/multipath.py b/sos/plugins/multipath.py
index b371bdf0..8272ac1e 100644
--- a/sos/plugins/multipath.py
+++ b/sos/plugins/multipath.py
@@ -1,20 +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.
-import os
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
class Multipath(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""device-mapper multipath information
"""
diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py
index 71e6413c..fdd69dea 100644
--- a/sos/plugins/mysql.py
+++ b/sos/plugins/mysql.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 Mysql(Plugin):
"""MySQL and MariaDB related information
diff --git a/sos/plugins/named.py b/sos/plugins/named.py
index 59858656..dc41cb1d 100644
--- a/sos/plugins/named.py
+++ b/sos/plugins/named.py
@@ -1,20 +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
from os.path import exists, join, normpath
-import pdb
+
class Named(Plugin):
"""named related information
@@ -39,7 +39,8 @@ class Named(Plugin):
def get_dns_dir(self, config_file):
""" grab directory path from named{conf,boot}
"""
- directory_list = self.do_regex_find_all("directory\s+\"(.*)\"", config_file)
+ directory_list = self.do_regex_find_all("directory\s+\"(.*)\"",
+ config_file)
if directory_list:
return normpath(directory_list[0])
else:
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index 4bf67526..c083b8bd 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -1,37 +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
+from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
import os
import re
+
class Networking(Plugin):
"""network related information
"""
plugin_name = "networking"
trace_host = "www.example.com"
option_list = [("traceroute", "collects a traceroute to %s" % trace_host,
- "slow", False)]
-
- def setup(self):
- super(Networking, self).setup()
+ "slow", False)]
- def get_bridge_name(self,brctl_file):
+ def get_bridge_name(self, brctl_file):
"""Return a list for which items are bridge name according to the
output of brctl show stored in brctl_file.
"""
- out=[]
+ out = []
try:
brctl_out = open(brctl_file).read()
except:
@@ -45,31 +43,31 @@ class Networking(Plugin):
out.append(br_name)
return out
- def get_eth_interfaces(self,ip_link_out):
+ def get_eth_interfaces(self, ip_link_out):
"""Return a dictionary for which keys are ethernet interface
names taken from the output of "ip -o link".
"""
- out={}
+ out = {}
for line in ip_link_out.splitlines():
- match=re.match('.*link/ether', line)
+ match = re.match('.*link/ether', line)
if match:
- iface=match.string.split(':')[1].lstrip()
- out[iface]=True
+ iface = match.string.split(':')[1].lstrip()
+ out[iface] = True
return out
- def collect_iptable(self,tablename):
+ def collect_iptable(self, tablename):
""" When running the iptables command, it unfortunately auto-loads
the modules before trying to get output. Some people explicitly
don't want this, so check if the modules are loaded before running
the command. If they aren't loaded, there can't possibly be any
relevant rules in that table """
-
if self.check_ext_prog("grep -q %s /proc/modules" % tablename):
cmd = "iptables -t "+tablename+" -nvL"
self.add_cmd_output(cmd)
def setup(self):
+ super(Networking, self).setup()
self.add_copy_specs([
"/proc/net/",
"/etc/nsswitch.conf",
@@ -89,12 +87,11 @@ class Networking(Plugin):
self.add_forbidden_path("/proc/net/rpc/*/channel")
self.add_forbidden_path("/proc/net/rpc/*/flush")
- ip_addr_file=self.get_cmd_output_now("ip -o addr", root_symlink = "ip_addr")
- self.add_cmd_output("route -n", root_symlink = "route")
+ self.add_cmd_output("route -n", root_symlink="route")
self.collect_iptable("filter")
self.collect_iptable("nat")
self.collect_iptable("mangle")
- self.add_cmd_output("netstat -neopa", root_symlink = "netstat")
+ self.add_cmd_output("netstat -neopa", root_symlink="netstat")
self.add_cmd_outputs([
"netstat -s",
"netstat -agn",
@@ -111,7 +108,7 @@ class Networking(Plugin):
"nmcli device status",
"biosdevname -d"
])
- ip_link_result=self.call_ext_prog("ip -o link")
+ ip_link_result = self.call_ext_prog("ip -o link")
if ip_link_result['status'] == 0:
for eth in self.get_eth_interfaces(ip_link_result['output']):
self.add_cmd_outputs([
@@ -124,17 +121,19 @@ class Networking(Plugin):
"ethtool -g "+eth
])
- brctl_file=self.get_cmd_output_now("brctl show")
+ brctl_file = self.get_cmd_output_now("brctl show")
if brctl_file:
for br_name in self.get_bridge_name(brctl_file):
self.add_cmd_output("brctl showstp "+br_name)
-
- nmcli_con_show_result=self.call_ext_prog("nmcli --terse --fields NAME con show")
+
+ nmcli_con_show_result = self.call_ext_prog(
+ "nmcli --terse --fields NAME con show")
if nmcli_con_show_result:
for con in nmcli_con_show_result['output'].splitlines():
self.add_cmd_output("nmcli connection show "+con)
- nmcli_dev_status_result=self.call_ext_prog("nmcli --terse --fields DEVICE dev status")
+ nmcli_dev_status_result = self.call_ext_prog(
+ "nmcli --terse --fields DEVICE dev status")
if nmcli_dev_status_result:
for dev in nmcli_dev_status_result['output'].splitlines():
self.add_cmd_output("nmcli device show "+dev)
@@ -145,17 +144,23 @@ class Networking(Plugin):
return
def postproc(self):
- for root, dirs, files in os.walk("/etc/NetworkManager/system-connections"):
+ for root, dirs, files in os.walk(
+ "/etc/NetworkManager/system-connections"):
for net_conf in files:
- self.do_file_sub("/etc/NetworkManager/system-connections/"+net_conf, r"psk=(.*)",r"psk=***")
+ self.do_file_sub(
+ "/etc/NetworkManager/system-connections/"+net_conf,
+ r"psk=(.*)", r"psk=***")
+
class RedHatNetworking(Networking, RedHatPlugin):
"""network related information for RedHat based distribution
"""
trace_host = "rhn.redhat.com"
+
def setup(self):
super(RedHatNetworking, self).setup()
+
class UbuntuNetworking(Networking, UbuntuPlugin):
"""network related information for Ubuntu based distribution
"""
diff --git a/sos/plugins/nfs.py b/sos/plugins/nfs.py
index 5b6ffa0f..44535215 100644
--- a/sos/plugins/nfs.py
+++ b/sos/plugins/nfs.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 Nfs(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""NFS related information
"""
@@ -22,10 +23,10 @@ class Nfs(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
def setup(self):
self.add_copy_specs([
- "/etc/nfsmount.conf",
- "/etc/idmapd.conf",
- "/proc/fs/nfsfs/servers",
- "/proc/fs/nfsfs/volumes"
+ "/etc/nfsmount.conf",
+ "/etc/idmapd.conf",
+ "/proc/fs/nfsfs/servers",
+ "/proc/fs/nfsfs/volumes"
])
return
diff --git a/sos/plugins/nfsserver.py b/sos/plugins/nfsserver.py
index 4dc9c20a..f85c0efe 100644
--- a/sos/plugins/nfsserver.py
+++ b/sos/plugins/nfsserver.py
@@ -1,23 +1,24 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo <eteo@redhat.com>
+# Copyright (C) 2007 Red Hat, Inc., Eugene Teo <eteo@redhat.com>
-### 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
from stat import ST_SIZE
+
class NfsServer(Plugin, RedHatPlugin):
"""NFS server-related information
"""
diff --git a/sos/plugins/nis.py b/sos/plugins/nis.py
index e4c59097..64fee689 100644
--- a/sos/plugins/nis.py
+++ b/sos/plugins/nis.py
@@ -1,22 +1,19 @@
-## nis.py
-## A plugin to gather all the NIS information
+# 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 Nis(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""NIS related information
diff --git a/sos/plugins/nscd.py b/sos/plugins/nscd.py
index b9769841..e8d545e2 100644
--- a/sos/plugins/nscd.py
+++ b/sos/plugins/nscd.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2007 Shijoe George <spanjikk@redhat.com>
+# Copyright (C) 2007 Shijoe George <spanjikk@redhat.com>
-### 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 Nscd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""NSCD related information
"""
@@ -33,6 +34,6 @@ class Nscd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
for o in opt:
f = o.split()
self.add_copy_spec_limit(f[1],
- sizelimit = self.get_option("log_size"))
+ sizelimit=self.get_option("log_size"))
# vim: et ts=4 sw=4
diff --git a/sos/plugins/ntp.py b/sos/plugins/ntp.py
index 0fba6f29..f4bfb06b 100644
--- a/sos/plugins/ntp.py
+++ b/sos/plugins/ntp.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 Ntp(Plugin):
"""NTP related information
"""
diff --git a/sos/plugins/oddjob.py b/sos/plugins/oddjob.py
index 3ca59741..1b6fd759 100644
--- a/sos/plugins/oddjob.py
+++ b/sos/plugins/oddjob.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
+# Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
-### 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 Oddjob(Plugin, RedHatPlugin):
"""oddjob related information
"""
diff --git a/sos/plugins/openhpi.py b/sos/plugins/openhpi.py
index 80053ed8..aba66728 100644
--- a/sos/plugins/openhpi.py
+++ b/sos/plugins/openhpi.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 OpenHPI(Plugin, RedHatPlugin):
"""OpenHPI related information
@@ -29,7 +29,7 @@ class OpenHPI(Plugin, RedHatPlugin):
def postproc(self):
self.do_file_sub("/etc/openhpi/openhpi.conf",
- r'(\s*[Pp]ass.*\s*=\s*).*', r'\1********')
+ r'(\s*[Pp]ass.*\s*=\s*).*', r'\1********')
# vim: et ts=4 sw=4
diff --git a/sos/plugins/openshift.py b/sos/plugins/openshift.py
index 5b1a11f0..7879630f 100644
--- a/sos/plugins/openshift.py
+++ b/sos/plugins/openshift.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
import os.path
+
class Openshift(Plugin, RedHatPlugin):
'''Openshift related information'''
@@ -24,10 +25,10 @@ class Openshift(Plugin, RedHatPlugin):
# here for compatibility with external programs that call sosreport
# with these names.
option_list = [("broker", "Gathers broker specific files", "slow", False),
- ("node", "Gathers node specific files", "slow", False)]
+ ("node", "Gathers node specific files", "slow", False)]
ruby = "ruby193"
- vendor ="rh"
+ vendor = "rh"
def is_broker(self):
return os.path.exists("/etc/openshift/broker.conf")
@@ -74,7 +75,6 @@ class Openshift(Plugin, RedHatPlugin):
"/var/log/node-web-proxy/supervisor.log",
])
-
self.add_cmd_outputs([
"oo-accept-node -v",
"oo-admin-ctl-gears list",
@@ -85,25 +85,27 @@ class Openshift(Plugin, RedHatPlugin):
# Redact broker's MongoDB credentials:
# MONGO_PASSWORD="PasswordForOpenshiftUser"
self.do_file_sub('/etc/openshift/broker.conf',
- r"(MONGO_PASSWORD\s*=\s*)(.*)",
- r"\1*******")
+ r"(MONGO_PASSWORD\s*=\s*)(.*)",
+ r"\1*******")
# Redact session SHA keys:
# SESSION_SECRET=0c31...a7c8
self.do_file_sub('/etc/openshift/broker.conf',
- r"(SESSION_SECRET\s*=\s*)(.*)",
- r"\1*******")
+ r"(SESSION_SECRET\s*=\s*)(.*)",
+ r"\1*******")
self.do_file_sub('/etc/openshift/console.conf',
- r"(SESSION_SECRET\s*=\s*)(.*)",
- r"\1*******")
+ r"(SESSION_SECRET\s*=\s*)(.*)",
+ r"\1*******")
# Redact passwords of the form:
# plugin.activemq.pool.1.password = Pa$sW0Rd
- self.doRegexSub("/opt/%s/%s/root/etc/mcollective/server.cfg" % (self.vendor, self.ruby),
- r"(.*password\s*=\s*)\S+",
- r"\1********")
- self.doRegexSub("/opt/%s/%s/root/etc/mcollective/client.cfg" % (self.vendor, self.ruby),
- r"(.*password\s*=\s*)\S+",
- r"\1********")
+ self.doRegexSub("/opt/%s/%s/root/etc/mcollective/server.cfg" %
+ (self.vendor, self.ruby),
+ r"(.*password\s*=\s*)\S+",
+ r"\1********")
+ self.doRegexSub("/opt/%s/%s/root/etc/mcollective/client.cfg" %
+ (self.vendor, self.ruby),
+ r"(.*password\s*=\s*)\S+",
+ r"\1********")
# vim: et ts=4 sw=4
diff --git a/sos/plugins/openssl.py b/sos/plugins/openssl.py
index 549ae395..a7347760 100644
--- a/sos/plugins/openssl.py
+++ b/sos/plugins/openssl.py
@@ -1,21 +1,22 @@
-## Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
+# Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com>
-### 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 OpenSSL(Plugin):
"""openssl related information
"""
@@ -38,6 +39,7 @@ class OpenSSL(Plugin):
r"\1 ******"
)
+
class RedHatOpenSSL(OpenSSL, RedHatPlugin):
"""openssl related information for Red Hat distributions
"""
@@ -48,6 +50,7 @@ class RedHatOpenSSL(OpenSSL, RedHatPlugin):
super(RedHatOpenSSL, self).setup()
self.add_copy_spec("/etc/pki/tls/openssl.cnf")
+
class DebianOpenSSL(OpenSSL, DebianPlugin, UbuntuPlugin):
"""openssl related information for Debian distributions
"""
diff --git a/sos/plugins/openstack_ceilometer.py b/sos/plugins/openstack_ceilometer.py
index 223a5e45..31e00817 100644
--- a/sos/plugins/openstack_ceilometer.py
+++ b/sos/plugins/openstack_ceilometer.py
@@ -1,25 +1,27 @@
-## Copyright (C) 2013 Red Hat, Inc., Eoghan Lynn <eglynn@redhat.com>
-## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.com>
-## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
+# Copyright (C) 2013 Red Hat, Inc., Eoghan Lynn <eglynn@redhat.com>
+# Copyright (C) 2012 Rackspace US, Inc.
+# 2012 Justin Shepherd <jshepher@rackspace.com>
+# Copyright (C) 2009 Red Hat, Inc.
+# 2009 Joey Boggs <jboggs@redhat.com>
-### 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 OpenStackCeilometer(plugins.Plugin):
+class OpenStackCeilometer(Plugin):
"""Openstack Ceilometer related information."""
plugin_name = "openstack-ceilometer"
@@ -32,8 +34,11 @@ class OpenStackCeilometer(plugins.Plugin):
"/var/log/ceilometer"
])
-class DebianOpenStackCeilometer(OpenStackCeilometer, plugins.DebianPlugin, plugins.UbuntuPlugin):
- """OpenStackCeilometer related information for Debian based distributions."""
+
+class DebianOpenStackCeilometer(OpenStackCeilometer, DebianPlugin,
+ UbuntuPlugin):
+ """OpenStackCeilometer related information for Debian based distributions.
+ """
packages = (
'ceilometer-api',
@@ -46,7 +51,7 @@ class DebianOpenStackCeilometer(OpenStackCeilometer, plugins.DebianPlugin, plugi
)
-class RedHatOpenStackCeilometer(OpenStackCeilometer, plugins.RedHatPlugin):
+class RedHatOpenStackCeilometer(OpenStackCeilometer, RedHatPlugin):
"""OpenStackCeilometer related information for Red Hat distributions."""
packages = (
diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py
index 5c480708..43b20061 100644
--- a/sos/plugins/openstack_cinder.py
+++ b/sos/plugins/openstack_cinder.py
@@ -1,23 +1,21 @@
-## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
-## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.com>
-## Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com>
-## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
+# Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.com>
+# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com>
+# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
-### 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
@@ -28,7 +26,8 @@ class OpenStackCinder(Plugin):
plugin_name = "openstack-cinder"
option_list = [("log", "gathers openstack cinder logs", "slow", True),
- ("db", "gathers openstack cinder db version", "slow", False)]
+ ("db", "gathers openstack cinder db version", "slow",
+ False)]
def setup(self):
if self.get_option("db"):
@@ -64,6 +63,7 @@ class DebianOpenStackCinder(OpenStackCinder, DebianPlugin, UbuntuPlugin):
def setup(self):
super(DebianOpenStackCinder, self).setup()
+
class RedHatOpenStackCinder(OpenStackCinder, RedHatPlugin):
"""OpenStack related information for Red Hat distributions
"""