common_util: Print tar's stderr if error occurs.

Sometimes a devserver will fail to stage some artifacts and the only
error message that is seen is that tar failed with some non-zero exit
status.  This commit will redirect tar's stderr to stdout which will be
placed in the exception that it raises.  This will be helpful to see
what exactly went wrong.

BUG=chromium:653362
BRANCH=None
TEST=python -b common_util_unittest.py

Change-Id: I2188da5a5a3de5c3afa6ee365dadb888abb44b80
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/399418
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
diff --git a/common_util.py b/common_util.py
index 0cf7937..34e35e7 100644
--- a/common_util.py
+++ b/common_util.py
@@ -387,8 +387,9 @@
   if files_to_extract:
     cmd.extend(files_to_extract)
 
+  cmd_output = ''
   try:
-    cmd_output = subprocess.check_output(cmd)
+    cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
     if return_extracted_files:
       return [os.path.join(install_path, filename)
               for filename in cmd_output.strip('\n').splitlines()
@@ -396,8 +397,8 @@
     return []
   except subprocess.CalledProcessError, e:
     raise CommonUtilError(
-        'An error occurred when attempting to untar %s:\n%s' %
-        (tarball_path, e))
+        'An error occurred when attempting to untar %s:\n%s\n%s' %
+        (tarball_path, e, e.output))
 
 
 def IsInsideChroot():