Remove RuncommandCaptureOutput and RunCommandQuietly

Switch to use RunCommand with capture_output=True and quiet=True.

BUG=chromium:339596
CQ-DEPEND=CL:184448
CQ-DEPEND=CL:184478
TEST=trybot runs

Change-Id: I2935839979e32e61f262aab5d4431fa66ab18808
Reviewed-on: https://chromium-review.googlesource.com/184474
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
diff --git a/au_test_harness/vm_au_worker.py b/au_test_harness/vm_au_worker.py
index cde5f3c..8dc51c1 100644
--- a/au_test_harness/vm_au_worker.py
+++ b/au_test_harness/vm_au_worker.py
@@ -171,9 +171,10 @@
     if self.whitelist_chrome_crashes:
       command.append('--whitelist_chrome_crashes')
     self.TestInfo('Running smoke suite to verify image.')
-    result = cros_build_lib.RunCommandCaptureOutput(
+    result = cros_build_lib.RunCommand(
         command, print_cmd=False, combine_stdout_stderr=True,
-        cwd=constants.CROSUTILS_DIR, error_code_ok=True)
+        cwd=constants.CROSUTILS_DIR, error_code_ok=True,
+        capture_output=True)
 
     # If the command failed or printed warnings, print the output.
     if result.returncode != 0 or '@@@STEP_WARNINGS@@@' in result.output:
diff --git a/lib/mount_helper.py b/lib/mount_helper.py
index 16e9973..308db9d 100644
--- a/lib/mount_helper.py
+++ b/lib/mount_helper.py
@@ -19,13 +19,13 @@
          '--stateful_mountpt=%s' % stateful_dir]
   if read_only: cmd.append('--read_only')
   if safe: cmd.append('--safe')
-  cros_build_lib.RunCommandCaptureOutput(
-      cmd, print_cmd=False, cwd=constants.CROSUTILS_DIR)
+  cros_build_lib.RunCommand(
+      cmd, print_cmd=False, cwd=constants.CROSUTILS_DIR, capture_output=True)
 
 
 def UnmountImage(root_dir, stateful_dir):
   """Unmounts a Chromium OS image specified by mount dir points."""
   cmd = ['./mount_gpt_image.sh', '--unmount', '--rootfs_mountpt=%s' % root_dir,
          '--stateful_mountpt=%s' % stateful_dir]
-  cros_build_lib.RunCommandCaptureOutput(
-      cmd, print_cmd=False, cwd=constants.CROSUTILS_DIR)
+  cros_build_lib.RunCommand(
+      cmd, print_cmd=False, cwd=constants.CROSUTILS_DIR, capture_output=True)
diff --git a/lib/public_key_manager.py b/lib/public_key_manager.py
index c3aca6f..95c4886 100644
--- a/lib/public_key_manager.py
+++ b/lib/public_key_manager.py
@@ -34,8 +34,8 @@
       self._is_key_new = True
       if os.path.exists(self._full_target_key_path):
         cmd = ['diff', self.key_path, self._full_target_key_path]
-        res = cros_build_lib.RunCommandCaptureOutput(
-            cmd, print_cmd=False, error_code_ok=True)
+        res = cros_build_lib.RunCommand(
+            cmd, print_cmd=False, error_code_ok=True, capture_output=True)
         if not res.output: self._is_key_new = False
 
     finally:
@@ -72,5 +72,6 @@
       from_dir = git.ReinterpretPathForChroot(from_dir)
       cmd = ['bin/cros_make_image_bootable', from_dir, image,
              '--force_developer_mode']
-      cros_build_lib.RunCommandCaptureOutput(
-          cmd, print_cmd=False, enter_chroot=True, cwd=constants.SOURCE_ROOT)
+      cros_build_lib.RunCommand(
+          cmd, print_cmd=False, enter_chroot=True, cwd=constants.SOURCE_ROOT,
+          capture_output=True)
diff --git a/lib/test_helper.py b/lib/test_helper.py
index 508b903..1ebde20 100644
--- a/lib/test_helper.py
+++ b/lib/test_helper.py
@@ -16,7 +16,8 @@
 
 def _GetTotalMemoryGB():
   """Calculate total memory on this machine, in gigabytes."""
-  res = cros_build_lib.RunCommandCaptureOutput(['free', '-g'], print_cmd=False)
+  res = cros_build_lib.RunCommand(['free', '-g'], print_cmd=False,
+                                  capture_output=True)
   assert res.returncode == 0
   for line in res.output.splitlines():
     if line.startswith('Mem:'):