aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/__init__.py16
-rw-r--r--sos/plugins/selinux.py5
2 files changed, 15 insertions, 6 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 0e9e4c3d..2eb160e1 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -498,14 +498,24 @@ class Plugin(object):
def get_cmd_path(self):
"""Return a path into which this module should store collected
- command output"""
+ command output
+ """
return os.path.join(self.archive.get_tmp_dir(),
'sos_commands', self.name())
+ def make_cmd_path(self, path):
+ """Return a string representing an absolute path within this
+ plug-in's command output directory by apending the relative path
+ name 'path'.
+ """
+ return os.path.join(self.get_cmd_path(), path)
+
+
def make_cmd_dirs(self, path):
"""Recursively create new subdirectories under this plug-in's
- command output path."""
- os.makedirs(self.get_cmd_path(), path)
+ command output path.
+ """
+ os.makedirs(self.make_cmd_path(path))
def file_grep(self, regexp, *fnames):
"""Returns lines matched in fnames, where fnames can either be
diff --git a/sos/plugins/selinux.py b/sos/plugins/selinux.py
index daa1bf77..b5aff468 100644
--- a/sos/plugins/selinux.py
+++ b/sos/plugins/selinux.py
@@ -34,9 +34,8 @@ class SELinux(Plugin, RedHatPlugin):
self.add_cmd_output("selinuxconlist root")
self.add_cmd_output("selinuxexeccon /bin/passwd")
self.add_cmd_output("ausearch -m avc,user_avc -ts today")
- semanage_custom_dest = join(self.get_cmd_path(),
- "selinux.custom")
- self.add_cmd_output("semanage -o %s" % semanage_custom_dest)
+ self.add_cmd_output("semanage -o %s"
+ % self.make_cmd_path("selinux.custom"))
if self.get_option('fixfiles'):
self.add_cmd_output("fixfiles -v check")
if self.get_option('list'):