Skip to content

Commit

Permalink
Merge pull request #128 from battlemidget/pyflakes-fixes
Browse files Browse the repository at this point in the history
Pyflakes fixes
  • Loading branch information
bmr-cymru committed Apr 16, 2013
2 parents 260100a + 7d1760c commit 40e3b77
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 20 deletions.
5 changes: 5 additions & 0 deletions sos/archive.py
Expand Up @@ -27,6 +27,11 @@
# required for compression callout (FIXME: move to policy?)
from subprocess import Popen, PIPE, STDOUT

try:
import selinux
except ImportError:
pass

try:
from cStringIO import StringIO
except ImportError:
Expand Down
1 change: 0 additions & 1 deletion sos/plugins/cgroups.py
Expand Up @@ -39,5 +39,4 @@ def setup(self):
"/etc/cgsnapshot_blacklist.conf",
"/etc/cgconfig.conf",
"/etc/cgrules.conf"])
cgroups.setup(self)

8 changes: 4 additions & 4 deletions sos/plugins/dhcp.py
Expand Up @@ -14,20 +14,20 @@

from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin

class dhcp(Plugin):
class Dhcp(Plugin):
"""DHCP related information
"""

plugin_name = "dhcp"

class RedHatDhcp(dhcp, RedHatPlugin):
class RedHatDhcp(Dhcp, RedHatPlugin):
"""DHCP related information for Red Hat based distributions"""

files = ('/etc/rc.d/init.d/dhcpd',)
packages = ('dhcp',)

def setup(self):
super(DhcpRedHat, self).setup()
super(RedHatDhcp, self).setup()
self.add_copy_specs([
"/etc/dhcpd.conf",
"/etc/dhcp"])
Expand All @@ -39,7 +39,7 @@ class UbuntuDhcp(dhcp, UbuntuPlugin):
packages = ('udhcpd',)

def setup(self):
super(DhcpDebian, self).setup()
super(DebianDhcp, self).setup()
self.add_copy_specs([
"/etc/default/udhcpd",
"/etc/udhcpd.conf"
Expand Down
9 changes: 5 additions & 4 deletions sos/plugins/iscsitarget.py
Expand Up @@ -17,30 +17,31 @@

from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin

class iscsitarget(Plugin):
class Iscsitarget(Plugin):
"""iscsi-target related information
"""

plugin_name = "iscsitarget"

class RedHatIscsiTarget(Plugin, RedHatPlugin):
class RedHatIscsiTarget(Iscsitarget, RedHatPlugin):
"""iscsi-target related information for Red Hat distributions
"""

packages = ('scsi-target-utils',)

def setup(self):
super(RedHatIscsiTarget, self).setup()
self.add_copy_spec("/etc/tgt/targets.conf")
self.add_cmd_output("tgtadm --lld iscsi --op show --mode target")

class DebianIscsiTarget(iscsitarget, DebianPlugin, UbuntuPlugin):
class DebianIscsiTarget(Iscsitarget, DebianPlugin, UbuntuPlugin):
"""iscsi-target related information for Debian based distributions
"""

packages = ('iscsitarget',)

def setup(self):
super(DebianIscsi, self).setup()
super(DebianIscsiTarget, self).setup()
self.add_copy_specs([
"/etc/iet",
"/etc/sysctl.d/30-iscsitarget.conf",
Expand Down
6 changes: 1 addition & 5 deletions sos/plugins/process.py
Expand Up @@ -16,7 +16,7 @@
import time
import os

class process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""process information
"""
def setup(self):
Expand All @@ -25,7 +25,3 @@ def setup(self):
self.add_cmd_output("ps alxwww")
self.add_cmd_output("pstree", root_symlink = "pstree")
self.add_cmd_output("lsof -b +M -n -l", root_symlink = "lsof")

def find_mountpoint(s):
if (os.path.ismount(s) or len(s)==0): return s
else: return mountpoint(os.path.split(s)[0])
2 changes: 1 addition & 1 deletion sos/plugins/selinux.py
Expand Up @@ -31,7 +31,7 @@ def setup(self):
# Check for SELinux denials and capture raw output from sealert
if self.policy().default_runlevel() in self.policy().runlevel_by_service("setroubleshoot"):
# TODO: fixup regex for more precise matching
sealert=do_regex_find_all(r"^.*setroubleshoot:.*(sealert\s-l\s.*)","/var/log/messages")
sealert=do_regex_findall(r"^.*setroubleshoot:.*(sealert\s-l\s.*)","/var/log/messages")
if sealert:
for i in sealert:
self.add_cmd_output("%s" % i)
Expand Down
1 change: 1 addition & 0 deletions sos/policies/__init__.py
Expand Up @@ -5,6 +5,7 @@
import platform
import time
import fnmatch
import sys
from os import environ

from sos.utilities import ImporterHelper, \
Expand Down
4 changes: 0 additions & 4 deletions sos/utilities.py
Expand Up @@ -35,10 +35,6 @@
import hashlib
import logging
import fnmatch
try:
import selinux
except ImportError:
pass

from contextlib import closing
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exe.py
@@ -1,2 +1,2 @@
#!/usr/bin/env python
#!/usr/bin/python
print "executed"

0 comments on commit 40e3b77

Please sign in to comment.