aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/networking.py4
-rw-r--r--sos/plugintools.py18
2 files changed, 1 insertions, 21 deletions
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index 9dd096dc..b0b92a55 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -35,13 +35,11 @@ class networking(sos.plugintools.PluginBase):
the command. If they aren't loaded, there can't possibly be any
relevant rules in that table """
- cmd = "/sbin/iptables -t "+tablename+" -nvL"
(status, output, time) = self.callExtProg("/sbin/lsmod | grep -q "+tablename)
if status == 0:
+ cmd = "/sbin/iptables -t "+tablename+" -nvL"
self.collectExtOutput(cmd)
- else:
- self.writeTextToCommand(cmd,"IPTables module "+tablename+" not loaded\n")
def setup(self):
self.addCopySpec("/proc/net")
diff --git a/sos/plugintools.py b/sos/plugintools.py
index e1628b80..6f3a4df6 100644
--- a/sos/plugintools.py
+++ b/sos/plugintools.py
@@ -409,24 +409,6 @@ class PluginBase:
return outfn
- def writeTextToCommand(self, exe, text):
- """ A function that allows you to write a random text string to the
- command output location referenced by exe; this is useful if you want
- to conditionally collect information, but still want the output file
- to exist so as not to confuse readers """
-
- outfn = self.makeCommandFilename(exe)
-
- if not os.path.isdir(os.path.dirname(outfn)):
- os.mkdir(os.path.dirname(outfn))
-
- outfd = open(outfn, "w")
- outfd.write(text)
- outfd.close()
-
- self.executedCommands.append({'exe': exe, 'file': outfn}) # save in our list
- return outfn
-
# For adding warning messages regarding configuration sanity
def addDiagnose(self, alertstring):
""" Add a configuration sanity warning for this plugin. These