mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-27 05:21:34 +01:00
Update RemoteUpload to return a set Update if failed_uploads to check deeper
in the returned set to see if it is a bonified failure BUG=NA TEST=Local run to verify Review URL: http://codereview.chromium.org/3667005
This commit is contained in:
parent
807d018656
commit
96619e72e1
@ -212,7 +212,7 @@ def RemoteUpload(files, pool=10):
|
|||||||
pool: integer of maximum proesses to have at the same time.
|
pool: integer of maximum proesses to have at the same time.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Return a list of tuple arguments of the failed uploads
|
Return a set of tuple arguments of the failed uploads
|
||||||
"""
|
"""
|
||||||
# TODO(scottz) port this to use _RunManyParallel when it is available in
|
# TODO(scottz) port this to use _RunManyParallel when it is available in
|
||||||
# cros_build_lib
|
# cros_build_lib
|
||||||
@ -224,7 +224,7 @@ def RemoteUpload(files, pool=10):
|
|||||||
result = pool.map_async(_GsUpload, workers, chunksize=1)
|
result = pool.map_async(_GsUpload, workers, chunksize=1)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
return result.get(60*60)
|
return set(result.get(60*60))
|
||||||
except multiprocessing.TimeoutError:
|
except multiprocessing.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -283,8 +283,9 @@ def UploadPrebuilt(build_path, bucket, board=None, git_file=None):
|
|||||||
|
|
||||||
print 'Uploading %s' % package_string
|
print 'Uploading %s' % package_string
|
||||||
failed_uploads = RemoteUpload(upload_files)
|
failed_uploads = RemoteUpload(upload_files)
|
||||||
if failed_uploads:
|
if len(failed_uploads) > 1 or (None not in failed_uploads):
|
||||||
raise UploadFailed('Error uploading:\n%s' % '\n'.join(failed_uploads))
|
error_msg = ['%s -> %s\n' % args for args in failed_uploads]
|
||||||
|
raise UploadFailed('Error uploading:\n%s' % error_msg)
|
||||||
|
|
||||||
if git_file:
|
if git_file:
|
||||||
RevGitFile(git_file, package_string, version)
|
RevGitFile(git_file, package_string, version)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user