aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-22 19:42:05 +0000
committerpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-22 19:42:05 +0000
commite45f5ad25df9d31ffd6c870419de1f9aed4859b2 (patch)
tree1637a55d82f131d8b04573f091788d111d5531fd
parent869f23704aef414bf132c86f1fefdba48f3be537 (diff)
downloadsos-e45f5ad25df9d31ffd6c870419de1f9aed4859b2.tar.gz
Removing writeTextToCommand()
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1021 ef72aa8b-4018-0410-8976-d6e080ef94d8
-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