From 76c04a773f1927359d264f59e4fbcc9363424882 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 29 Jan 2015 22:00:10 +0000 Subject: [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 --- sos/plugins/__init__.py | 3 +++ sos/sosreport.py | 1 + 2 files changed, 4 insertions(+) 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") -- cgit