diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2015-01-29 22:00:10 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-07-08 17:05:22 +0100 |
commit | 76c04a773f1927359d264f59e4fbcc9363424882 (patch) | |
tree | f562c75ce3da1fd1a308e283ce44db0a9ec12a14 | |
parent | 8d69d74a5be6dac29fad2ab5d7206a0485969924 (diff) | |
download | sos-76c04a773f1927359d264f59e4fbcc9363424882.tar.gz |
[plugins] trim leading '../' from links when sysroot is set
When SYSROOT is not '/' relative symlinks need to be trimmed to
remove the extra leading '../' returned by
abspath('/sysroot/...').
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/__init__.py | 3 | ||||
-rw-r--r-- | sos/sosreport.py | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index a7c0146b..a06c0b1b 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -271,6 +271,9 @@ class Plugin(object): # adjust the target used inside the report to always be relative if os.path.isabs(linkdest): reldest = os.path.relpath(linkdest, os.path.dirname(srcpath)) + # trim leading /sysroot + if self.use_sysroot(): + reldest = reldest[len(os.sep + os.pardir):] self._log_debug("made link target '%s' relative as '%s'" % (linkdest, reldest)) else: diff --git a/sos/sosreport.py b/sos/sosreport.py index 27c756f7..567e3dfb 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -1226,6 +1226,7 @@ class SoSReport(object): self.ui_log.error(" %s while setting up plugins" % e.strerror) self.ui_log.error("") + self._exit(1) if self.raise_plugins: raise self._log_plugin_exception(plugname, "setup") |