diff options
-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") |