Make download_from_google_storage.py print nothing in the happy case where it needs to do nothing.

The script prints a bunch of stuff behind `if verbose` checks, but then
"verbose" was turned on by default in
https://bugs.chromium.org/p/chromium/issues/detail?id=504452

I think the wrong lesson was learned from that bug – it sounds like the
problem was that an error message was printed only if verbose was set.
After this change, the script is silent when it does nothing, and prints
something if something happens. (Arguably, it still prints too much in the
case where it successfully downloads something.)

This is part of a few changes to make `gclient runhooks` less noisy.

Bug: 772741,504452
Change-Id: I5823c296abe97611ba4411bab2743673b10dca4b
Reviewed-on: https://chromium-review.googlesource.com/706915
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
This commit is contained in:
Nico Weber
2017-10-09 15:42:44 -04:00
committed by Commit Bot
parent 8db10a6fb1
commit 87677e9830
3 changed files with 29 additions and 28 deletions

View File

@@ -18,7 +18,7 @@ import time
from download_from_google_storage import get_sha1
from download_from_google_storage import Gsutil
from download_from_google_storage import printer_worker
from download_from_google_storage import PrinterThread
from download_from_google_storage import GSUTIL_DEFAULT_PATH
USAGE_STRING = """%prog [options] target [target2 ...].
@@ -145,7 +145,7 @@ def upload_to_google_storage(
upload_queue = Queue.Queue()
upload_timer = time.time()
stdout_queue = Queue.Queue()
printer_thread = threading.Thread(target=printer_worker, args=[stdout_queue])
printer_thread = PrinterThread(stdout_queue)
printer_thread.daemon = True
printer_thread.start()
for thread_num in range(num_threads):