aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-01-25 15:04:29 +0000
committerBryn M. Reeves <bmr@redhat.com>2015-07-08 17:05:20 +0100
commit0d060dc3aa5e90373e7bb55f9310b4cf9db0dad4 (patch)
tree1398323a4a0ac0b78b2249b44373d5810052d2bc
parent9a87cb3415a7a9587828ee40d689439949def1be (diff)
downloadsos-0d060dc3aa5e90373e7bb55f9310b4cf9db0dad4.tar.gz
[plugins] implement --chroot for command callouts
When --chroot=always is given chroot all commands to SYSROOT. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 137e1a1a..10fdae53 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -499,8 +499,12 @@ class Plugin(object):
self._log_info("added copyspec '%s'" % copy_paths)
def get_command_output(self, prog, timeout=300, runat=None, stderr=True):
- result = sos_get_command_output(prog, timeout=timeout, chdir=runat,
- stderr=stderr)
+ if self.commons['cmdlineopts'].chroot == 'always':
+ root = self.sysroot
+ else:
+ root = None
+ result = sos_get_command_output(prog, timeout=timeout, stderr=stderr
+ chroot=root, chdir=runat)
if result['status'] == 124:
self._log_warn("command '%s' timed out after %ds"
% (prog, timeout))