Bug 1574948 - Call delete after upload to avoid Contents key error. r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D42700

--HG--
extra : moz-landing-system : lando
This commit is contained in:
championshuttler 2019-08-21 12:45:49 +00:00
parent c63e3dbb3b
commit a3b25b205c

View File

@ -137,7 +137,6 @@ def s3_upload(files, key_prefix=None):
defined, key names will be ``<key_prefix>/<path>``.
"""
s3, bucket = create_aws_session()
s3_delete_missing(files, key_prefix)
def upload(f, path, bucket, key, extra_args):
# Need to flush to avoid buffering/interleaving from multiple threads.
@ -165,6 +164,7 @@ def s3_upload(files, key_prefix=None):
fs.append(e.submit(upload, io.BytesIO(f.read()), path, bucket, key,
extra_args))
s3_delete_missing(files, key_prefix)
# Need to do this to catch any exceptions.
for f in fs:
f.result()