Commit 088dfc03 authored by prasadv's avatar prasadv Committed by Commit Bot

Add exception handling while downloading builds

TBR=mmoss@chromium.org

Change-Id: I7e4f37f33702eebccf199bec997ec9e9e23fb33a
Reviewed-on: https://chromium-review.googlesource.com/959573Reviewed-by: default avatarPrasad Vuppalapu <prasadv@chromium.org>
Commit-Queue: Prasad Vuppalapu <prasadv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542637}
parent 1bcb2e39
...@@ -235,7 +235,13 @@ def download_build(cp_num, revision_map, zip_file_name, context): ...@@ -235,7 +235,13 @@ def download_build(cp_num, revision_map, zip_file_name, context):
remote_file_path = '%s/%s_%s.zip' % (context.original_remote_path, remote_file_path = '%s/%s_%s.zip' % (context.original_remote_path,
context.file_prefix, context.file_prefix,
revision_map[cp_num]) revision_map[cp_num])
cloud_storage.Get(context.original_gs_bucket, remote_file_path, zip_file_name) try:
cloud_storage.Get(context.original_gs_bucket,
remote_file_path, zip_file_name)
except Exception, e:
logging.warning('Failed to download: %s, error: %s', zip_file_name, e)
return False
return True
def upload_build(zip_file, context): def upload_build(zip_file, context):
...@@ -247,14 +253,8 @@ def upload_build(zip_file, context): ...@@ -247,14 +253,8 @@ def upload_build(zip_file, context):
def download_revision_map(context): def download_revision_map(context):
"""Downloads the revision map in original_gs_url in context.""" """Downloads the revision map in original_gs_url in context."""
download_file = '%s/%s' % (context.repackage_remote_path, REVISION_MAP_FILE) download_file = '%s/%s' % (context.repackage_remote_path, REVISION_MAP_FILE)
try: cloud_storage.Get(context.repackage_gs_bucket, download_file,
cloud_storage.Get(context.original_gs_bucket, context.revision_file)
remote_file_path, zip_file_name)
except Exception, e:
logging.warning('Failed to download: %s, error: %s', zip_file_name, e)
return False
return True
def get_revision_map(context): def get_revision_map(context):
"""Downloads and returns the revision map in repackage_gs_url in context.""" """Downloads and returns the revision map in repackage_gs_url in context."""
......
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