aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-01-23 15:24:00 +0000
committerBryn M. Reeves <bmr@redhat.com>2015-07-07 20:55:56 +0100
commit3eed62e132f67930bb1cf5c9eaa5927083011043 (patch)
tree2030c8e21b360b743f700fd11090049c15b98aa7
parentcb3d265849771f7e53b0587196930328005414e0 (diff)
downloadsos-3eed62e132f67930bb1cf5c9eaa5927083011043.tar.gz
[plugins] propagate sysroot to Plugin via commons
Although plugins should generally be unaware that they are being run with an alternate sysroot the generic plugin IO code must peform the appropriate path prefixing when sysroot is not '/'. Propagate sysroot to plugin classes via the commons dictionary. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 47eddc97..580b5bd7 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -651,6 +651,7 @@ class SoSReport(object):
self.archive = None
self.tempfile_util = None
self._args = args
+ self.sysroot = "/"
try:
import signal
@@ -681,6 +682,10 @@ class SoSReport(object):
self.tempfile_util = TempFileUtil(self.tmpdir)
self._set_directories()
+ # set alternate system root directory
+ if self.opts.sysroot:
+ self.sysroot = self.opts.sysroot
+
def print_header(self):
self.ui_log.info("\n%s\n" % _("sosreport (version %s)" %
(__version__,)))
@@ -693,6 +698,7 @@ class SoSReport(object):
'tmpdir': self.tmpdir,
'soslog': self.soslog,
'policy': self.policy,
+ 'sysroot': self.sysroot,
'verbosity': self.opts.verbosity,
'xmlreport': self.xml_report,
'cmdlineopts': self.opts,