Skip to content

Commit

Permalink
Merge 4b1f4bf into dd56844
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanpm committed Feb 4, 2022
2 parents dd56844 + 4b1f4bf commit 531d817
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions support/reftest/reftest
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,24 @@ class S3Handler:
self.bucket = bucket

def upload_from_localfile(self, path, checksum):
with open(path, "rb") as data:
self.s3_client.upload_fileobj(
Fileobj=data, Bucket=self.bucket, Key=checksum
)
st = os.stat(path)
bar = tqdm(
desc="%s [upload]" % checksum,
total=st.st_size,
unit="iB",
unit_scale=True,
)

try:
with open(path, "rb") as data:
self.s3_client.upload_fileobj(
Fileobj=data,
Bucket=self.bucket,
Key=checksum,
Callback=bar.update,
)
finally:
bar.close()


def parse_aws_session(parser):
Expand Down

0 comments on commit 531d817

Please sign in to comment.