Commit 6bba5a9b authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Restore (unused) "verbose" paramter in download_from_google_storage.py

Apparently several scripts in other repros call this function directly.

Bug: 772741
Change-Id: I486483e44a072af6cf8c75373a2da6ef5469fc2c
TBR=dpranke
Reviewed-on: https://chromium-review.googlesource.com/707937
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: 's avatarNico Weber <thakis@chromium.org>
parent f6929a12
...@@ -215,7 +215,7 @@ def _validate_tar_file(tar, prefix): ...@@ -215,7 +215,7 @@ def _validate_tar_file(tar, prefix):
return all(map(_validate, tar.getmembers())) return all(map(_validate, tar.getmembers()))
def _downloader_worker_thread(thread_num, q, force, base_url, def _downloader_worker_thread(thread_num, q, force, base_url,
gsutil, out_q, ret_codes, extract, gsutil, out_q, ret_codes, verbose, extract,
delete=True): delete=True):
while True: while True:
input_sha1_sum, output_filename = q.get() input_sha1_sum, output_filename = q.get()
...@@ -341,7 +341,7 @@ class PrinterThread(threading.Thread): ...@@ -341,7 +341,7 @@ class PrinterThread(threading.Thread):
def download_from_google_storage( def download_from_google_storage(
input_filename, base_url, gsutil, num_threads, directory, recursive, input_filename, base_url, gsutil, num_threads, directory, recursive,
force, output, ignore_errors, sha1_file, auto_platform, extract): force, output, ignore_errors, sha1_file, verbose, auto_platform, extract):
# Start up all the worker threads. # Start up all the worker threads.
all_threads = [] all_threads = []
download_start = time.time() download_start = time.time()
...@@ -353,7 +353,7 @@ def download_from_google_storage( ...@@ -353,7 +353,7 @@ def download_from_google_storage(
t = threading.Thread( t = threading.Thread(
target=_downloader_worker_thread, target=_downloader_worker_thread,
args=[thread_num, work_queue, force, base_url, args=[thread_num, work_queue, force, base_url,
gsutil, stdout_queue, ret_codes, extract]) gsutil, stdout_queue, ret_codes, verbose, extract])
t.daemon = True t.daemon = True
t.start() t.start()
all_threads.append(t) all_threads.append(t)
...@@ -538,7 +538,7 @@ def main(args): ...@@ -538,7 +538,7 @@ def main(args):
return download_from_google_storage( return download_from_google_storage(
input_filename, base_url, gsutil, options.num_threads, options.directory, input_filename, base_url, gsutil, options.num_threads, options.directory,
options.recursive, options.force, options.output, options.ignore_errors, options.recursive, options.force, options.output, options.ignore_errors,
options.sha1_file, options.auto_platform, options.sha1_file, options.verbose, options.auto_platform,
options.extract) options.extract)
......
...@@ -230,7 +230,7 @@ class DownloadTests(unittest.TestCase): ...@@ -230,7 +230,7 @@ class DownloadTests(unittest.TestCase):
stdout_queue = Queue.Queue() stdout_queue = Queue.Queue()
download_from_google_storage._downloader_worker_thread( download_from_google_storage._downloader_worker_thread(
0, self.queue, False, self.base_url, self.gsutil, 0, self.queue, False, self.base_url, self.gsutil,
stdout_queue, self.ret_codes, True) stdout_queue, self.ret_codes, True, False)
expected_calls = [ expected_calls = [
('check_call', ('check_call',
('ls', input_filename)), ('ls', input_filename)),
...@@ -256,7 +256,7 @@ class DownloadTests(unittest.TestCase): ...@@ -256,7 +256,7 @@ class DownloadTests(unittest.TestCase):
stdout_queue = Queue.Queue() stdout_queue = Queue.Queue()
download_from_google_storage._downloader_worker_thread( download_from_google_storage._downloader_worker_thread(
0, self.queue, False, self.base_url, self.gsutil, 0, self.queue, False, self.base_url, self.gsutil,
stdout_queue, self.ret_codes, True) stdout_queue, self.ret_codes, True, False)
expected_output = [ expected_output = [
'0> File %s exists and SHA1 matches. Skipping.' % output_filename '0> File %s exists and SHA1 matches. Skipping.' % output_filename
] ]
...@@ -278,7 +278,7 @@ class DownloadTests(unittest.TestCase): ...@@ -278,7 +278,7 @@ class DownloadTests(unittest.TestCase):
stdout_queue = Queue.Queue() stdout_queue = Queue.Queue()
download_from_google_storage._downloader_worker_thread( download_from_google_storage._downloader_worker_thread(
0, self.queue, True, self.base_url, self.gsutil, 0, self.queue, True, self.base_url, self.gsutil,
stdout_queue, self.ret_codes, True, delete=False) stdout_queue, self.ret_codes, True, True, delete=False)
expected_calls = [ expected_calls = [
('check_call', ('check_call',
('ls', input_filename)), ('ls', input_filename)),
...@@ -311,7 +311,7 @@ class DownloadTests(unittest.TestCase): ...@@ -311,7 +311,7 @@ class DownloadTests(unittest.TestCase):
self.gsutil.add_expected(1, '', '') # Return error when 'ls' is called. self.gsutil.add_expected(1, '', '') # Return error when 'ls' is called.
download_from_google_storage._downloader_worker_thread( download_from_google_storage._downloader_worker_thread(
0, self.queue, False, self.base_url, self.gsutil, 0, self.queue, False, self.base_url, self.gsutil,
stdout_queue, self.ret_codes, True) stdout_queue, self.ret_codes, True, False)
expected_output = [ expected_output = [
'0> Failed to fetch file %s for %s, skipping. [Err: ]' % ( '0> Failed to fetch file %s for %s, skipping. [Err: ]' % (
input_filename, output_filename), input_filename, output_filename),
...@@ -345,6 +345,7 @@ class DownloadTests(unittest.TestCase): ...@@ -345,6 +345,7 @@ class DownloadTests(unittest.TestCase):
output=output_filename, output=output_filename,
ignore_errors=False, ignore_errors=False,
sha1_file=False, sha1_file=False,
verbose=True,
auto_platform=False, auto_platform=False,
extract=False) extract=False)
expected_calls = [ expected_calls = [
...@@ -376,7 +377,7 @@ class DownloadTests(unittest.TestCase): ...@@ -376,7 +377,7 @@ class DownloadTests(unittest.TestCase):
self.gsutil.add_expected(0, '', '') self.gsutil.add_expected(0, '', '')
self.gsutil.add_expected(0, '', '', _write_bad_file) self.gsutil.add_expected(0, '', '', _write_bad_file)
download_from_google_storage._downloader_worker_thread( download_from_google_storage._downloader_worker_thread(
1, q, True, self.base_url, self.gsutil, out_q, ret_codes, True) 1, q, True, self.base_url, self.gsutil, out_q, ret_codes, True, False)
self.assertTrue(q.empty()) self.assertTrue(q.empty())
msg = ('1> ERROR remote sha1 (%s) does not match expected sha1 (%s).' % msg = ('1> ERROR remote sha1 (%s) does not match expected sha1 (%s).' %
('8843d7f92416211de9ebb963ff4ce28125932878', sha1_hash)) ('8843d7f92416211de9ebb963ff4ce28125932878', sha1_hash))
...@@ -402,6 +403,7 @@ class DownloadTests(unittest.TestCase): ...@@ -402,6 +403,7 @@ class DownloadTests(unittest.TestCase):
output=None, output=None,
ignore_errors=False, ignore_errors=False,
sha1_file=False, sha1_file=False,
verbose=True,
auto_platform=False, auto_platform=False,
extract=False) extract=False)
expected_calls = [ expected_calls = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment