aboutsummaryrefslogtreecommitdiffstats
path: root/sos/plugins/foreman.py
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-03-12 16:27:34 +0000
committerBryn M. Reeves <bmr@redhat.com>2014-03-12 17:53:11 +0000
commitef4e4b60eeaef33fa5e4ee074c6736cd3412397b (patch)
tree6b7416c208e4d343274833427b47005e946b6a3a /sos/plugins/foreman.py
parentc55c58cf2dabf93c924c839c8ed045c18e31ba1c (diff)
downloadsos-ef4e4b60eeaef33fa5e4ee074c6736cd3412397b.tar.gz
Clean up get_cmd_path/make_cmd_path/make_cmd_dirs mess
Clean up the Plugin helper methods for handling command output paths. This better matches the proposal in Issue #181 and simplifies code for plugins that need to generate their own paths under sos_commands/<plugin>/. - Rename get_cmd_path() to get_cmd_output_path() - Add an optional 'name' parameter to specify a subdirectory name in the plugin's sos_commands/<plugin>/ directory. - Default to creating directories if they do not exist Finally fix up all existing users of get_cmd_path() to use the new interface and remove handrolled uses of os.path.join(...) for generating these paths. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'sos/plugins/foreman.py')
-rw-r--r--sos/plugins/foreman.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py
index ab4dfcb3..a2f2881d 100644
--- a/sos/plugins/foreman.py
+++ b/sos/plugins/foreman.py
@@ -25,7 +25,5 @@ class Foreman(Plugin, RedHatPlugin):
packages = ('foreman')
def setup(self):
- foreman_debug_path = os.path.join(
- self.get_cmd_path(),"foreman-debug")
- self.add_cmd_output("%s -q -a -d %s"
- % ("foreman-debug", foreman_debug_path))
+ self.add_cmd_output("%s -q -a -d %s" % ("foreman-debug",
+ self.get_cmd_output_path(name="foreman-debug")))