cros_build_lib.py: remove RuncommandCaptureOutput and RunCommandQuietly

RunCommandCaptureOutput is a wrapper of RunCommand. In multiple
places, we have a layer to decide whether to call RunCommand or
RunCommandCaptureOutput. There is no reason to have callers adding
logic to decide this. Move the logic into RunCommand by adding a
keyword argument 'capture_output'.

Also replace RunCommandQuietly by using keyword 'quiet'.

BUG=chromium:339596
CQ-DEPEND=CL:184474
CQ-DEPEND=CL:184478
TEST=`buildbot/run_tests`
TEST=trybot runs

Change-Id: Id6561467c868b9ecbbfa2d111ceb6b00999d68b2
Reviewed-on: https://chromium-review.googlesource.com/184448
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/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 617a5f6..2623cb5 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -109,7 +109,8 @@
 
   def _GetRemoteMountFree(self, remote_dir):
     result = self.host.RemoteSh((DF_COMMAND if not self.content_shell
-                                 else DF_COMMAND_ANDROID) % remote_dir)
+                                 else DF_COMMAND_ANDROID) % remote_dir,
+                                capture_output=True)
     line = result.output.splitlines()[1]
     value = line.split()[3]
     multipliers = {
@@ -126,17 +127,18 @@
                       'directory size to properly calculate available free '
                       'space.')
       return 0
-    result = self.host.RemoteSh('du -ks %s' % remote_dir)
+    result = self.host.RemoteSh('du -ks %s' % remote_dir, capture_output=True)
     return int(result.output.split()[0])
 
   def _GetStagingDirSize(self):
     result = cros_build_lib.DebugRunCommand(['du', '-ks', self.staging_dir],
-                                            redirect_stdout=True)
+                                            redirect_stdout=True,
+                                            capture_output=True)
     return int(result.output.split()[0])
 
   def _ChromeFileInUse(self):
     result = self.host.RemoteSh(LSOF_COMMAND % (self.options.target_dir,),
-                                error_code_ok=True)
+                                error_code_ok=True, capture_output=True)
     return result.returncode == 0
 
   def _DisableRootfsVerification(self):
@@ -178,7 +180,7 @@
     # <job_name> <status> ['process' <pid>].
     # <status> is in the format <goal>/<state>.
     try:
-      result = self.host.RemoteSh('status ui')
+      result = self.host.RemoteSh('status ui', capture_output=True)
     except cros_build_lib.RunCommandError as e:
       if 'Unknown job' in e.result.error:
         return False
@@ -227,7 +229,8 @@
     # TODO: Should migrate to use the remount functions in remote_access.
     result = self.host.RemoteSh(MOUNT_RW_COMMAND if not self.content_shell
                                 else MOUNT_RW_COMMAND_ANDROID,
-                                error_code_ok=error_code_ok)
+                                error_code_ok=error_code_ok,
+                                capture_output=True)
     if result.returncode:
       self._rootfs_is_still_readonly.set()