Blame SOURCES/0058-plugins-implement-chroot-for-command-callouts.patch

0cd6dc
From cc4aad6e9574fcc236b485a25618c87c5b95a28e Mon Sep 17 00:00:00 2001
0cd6dc
From: "Bryn M. Reeves" <bmr@redhat.com>
0cd6dc
Date: Sun, 25 Jan 2015 15:04:29 +0000
0cd6dc
Subject: [PATCH 58/93] [plugins] implement --chroot for command callouts
0cd6dc
0cd6dc
When --chroot=always is given chroot all commands to SYSROOT.
0cd6dc
0cd6dc
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0cd6dc
---
0cd6dc
 sos/plugins/__init__.py | 7 ++++++-
0cd6dc
 1 file changed, 6 insertions(+), 1 deletion(-)
0cd6dc
0cd6dc
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
0cd6dc
index 3f8f628..9fa2802 100644
0cd6dc
--- a/sos/plugins/__init__.py
0cd6dc
+++ b/sos/plugins/__init__.py
0cd6dc
@@ -493,7 +493,12 @@ class Plugin(object):
0cd6dc
             self._log_info("added copyspec '%s'" % copy_paths)
0cd6dc
 
0cd6dc
     def get_command_output(self, prog, timeout=300, runat=None):
0cd6dc
-        result = sos_get_command_output(prog, timeout=timeout, chdir=runat)
0cd6dc
+        if self.commons['cmdlineopts'].chroot == 'always':
0cd6dc
+            root = self.sysroot
0cd6dc
+        else:
0cd6dc
+            root = None
0cd6dc
+        result = sos_get_command_output(prog, timeout=timeout,
0cd6dc
+                                        chroot=root, chdir=runat)
0cd6dc
         if result['status'] == 124:
0cd6dc
             self._log_warn("command '%s' timed out after %ds"
0cd6dc
                            % (prog, timeout))
0cd6dc
-- 
0cd6dc
1.9.3
0cd6dc