aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-01-26 15:32:03 -0500
committerBryn M. Reeves <bmr@redhat.com>2015-07-08 17:05:21 +0100
commitd7cf8535a3403fe6050e0905bef2b4429e595664 (patch)
treea455e1be2dab115c3891141f5366a0a2efeda828
parent550dda69c6c5d527498ad928a29c466fad4e250e (diff)
downloadsos-d7cf8535a3403fe6050e0905bef2b4429e595664.tar.gz
[utilities] add chroot support to shell_out()
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/utilities.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sos/utilities.py b/sos/utilities.py
index a82ac7c7..64756197 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -186,11 +186,12 @@ def import_module(module_fqname, superclasses=None):
return modules
-def shell_out(cmd, timeout=30, runat=None):
+def shell_out(cmd, timeout=30, chroot=None, runat=None):
"""Shell out to an external command and return the output or the empty
string in case of error.
"""
- return sos_get_command_output(cmd, timeout=timeout, chdir=runat)['output']
+ return sos_get_command_output(cmd, timeout=timeout,
+ chroot=chroot, chdir=runat)['output']
class ImporterHelper(object):