diff --git a/upload_to_google_storage.py b/upload_to_google_storage.py index 864fce9d8..9dce2b6fd 100755 --- a/upload_to_google_storage.py +++ b/upload_to_google_storage.py @@ -84,11 +84,11 @@ def _upload_worker( if gsutil.check_call('ls', file_url)[0] == 0 and not force: # File exists, check MD5 hash. _, out, _ = gsutil.check_call_with_retries('ls', '-L', file_url) - etag_match = re.search(r'ETag:\s+([a-z0-9]{32})', out) + etag_match = re.search(r'ETag:\s+\S+', out) if etag_match: stdout_queue.put( '%d> File with url %s already exists' % (thread_num, file_url)) - remote_md5 = etag_match.group(1) + remote_md5 = etag_match.group(0).split()[1] # Calculate the MD5 checksum to match it to Google Storage's ETag. with md5_lock: if use_md5: