mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Improve upload_to_google_storage.py missing file handling
When there are missing input files, upload_to_google_storage.py should not display 'Success'. Bug: 920654 Change-Id: I1bc7ba6e8eb48ea28b634da01e1be9a80af7b719 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2647870 Reviewed-by: Dirk Pranke <dpranke@google.com> Commit-Queue: John Chen <johnchen@chromium.org>
This commit is contained in:
@@ -167,9 +167,11 @@ def upload_to_google_storage(
|
||||
# We want to hash everything in a single thread since its faster.
|
||||
# The bottleneck is in disk IO, not CPU.
|
||||
hashing_start = time.time()
|
||||
has_missing_files = False
|
||||
for filename in input_filenames:
|
||||
if not os.path.exists(filename):
|
||||
stdout_queue.put('Main> Error: %s not found, skipping.' % filename)
|
||||
has_missing_files = True
|
||||
continue
|
||||
if os.path.exists('%s.sha1' % filename) and skip_hashing:
|
||||
stdout_queue.put(
|
||||
@@ -208,6 +210,9 @@ def upload_to_google_storage(
|
||||
max_ret_code = max(ret_code, max_ret_code)
|
||||
if message:
|
||||
print(message, file=sys.stderr)
|
||||
if has_missing_files:
|
||||
print('One or more input files missing', file=sys.stderr)
|
||||
max_ret_code = max(1, max_ret_code)
|
||||
|
||||
if not max_ret_code:
|
||||
print('Success!')
|
||||
|
||||
Reference in New Issue
Block a user