diff options
author | shnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-07-12 09:33:32 +0000 |
---|---|---|
committer | shnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-07-12 09:33:32 +0000 |
commit | 0f7e1f252f00c948209cbff8b376ba291d3facbc (patch) | |
tree | 29c87bf6837c04f2bca202a0905e0e4e15fe70ca /src | |
parent | 9af40ceda54d5979730d95999359da33191839fe (diff) | |
download | sos-0f7e1f252f00c948209cbff8b376ba291d3facbc.tar.gz |
* split up command outputs in sub-directories (sos_command/plugin/command instead of sos_command/plugin.command)
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@196 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/sos/plugintools.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py index 15fccfdf..e54aa6a5 100644 --- a/src/lib/sos/plugintools.py +++ b/src/lib/sos/plugintools.py @@ -288,7 +288,7 @@ class PluginBase: tabl = string.maketrans(" /\t;#$|%\"'`}{\n", "_._-----------") mangledname = rawcmd.translate(tabl) - outfn = self.cInfo['cmddir'] + "/" + self.piName + "." + mangledname + outfn = self.cInfo['cmddir'] + "/" + self.piName + "/" + mangledname # check for collisions while os.path.exists(outfn): @@ -313,6 +313,9 @@ class PluginBase: else: 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(shout) outfd.close() @@ -346,6 +349,9 @@ class PluginBase: 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() |