diff options
author | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-04-29 14:59:56 +0000 |
---|---|---|
committer | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-04-29 14:59:56 +0000 |
commit | 496f2ac5a20c1d1bd6a5879b9447fb6ea1592539 (patch) | |
tree | 31601e0ef3cf773e887302ac449c6267b48eae2e | |
parent | 207b862b28bc11058b1f5dd4d856e14b6b5c87fd (diff) | |
download | sos-496f2ac5a20c1d1bd6a5879b9447fb6ea1592539.tar.gz |
fix exception in sanitize plugin
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@950 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r-- | sos/plugins/sanitize.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sos/plugins/sanitize.py b/sos/plugins/sanitize.py index 00c883ee..3a94f971 100644 --- a/sos/plugins/sanitize.py +++ b/sos/plugins/sanitize.py @@ -20,13 +20,14 @@ import socket class sanitize(sos.plugintools.PluginBase): """ sanitize specified log files, etc """ + hostname = socket.gethostname() + def defaultenabled(self): # disabled by default b/c still a work in progress return False def setup(self): # sanitize ip's, hostnames in logs - hostname = socket.gethostname() rhelver = self.policy().rhelVersion() if rhelver == 5 or rhelver == 4: logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/syslog.conf") @@ -36,6 +37,6 @@ class sanitize(sos.plugintools.PluginBase): self.addCopySpec(log) def postproc(self): - self.doRegexSub('/var/log/messages', r"^\s+(%s)" % (hostname,), r"\1sanitized-hostname") + self.doRegexSub('/var/log/messages', r"^\s+(%s)" % (self.hostname,), r"\1sanitized-hostname") self.doRegexSub('/var/log/messages', r"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})", r"\1sanitized-ip") |