Commit fab4d955 authored by Elouan Martinet's avatar Elouan Martinet
Browse files

[storages] Add logging when downloading objects

parent 2736ca768ad6
...@@ -50,8 +50,9 @@ class S3Storage(Storage): ...@@ -50,8 +50,9 @@ class S3Storage(Storage):
""" """
key = source.binary_to_str(value).decode() key = source.binary_to_str(value).decode()
try: try:
return Binary(self.s3cnx.get_object( result = self.s3cnx.get_object(Bucket=self.bucket, Key=key)
Bucket=self.bucket, Key=key)['Body'].read())'Downloaded %s/%s from S3', self.bucket, key)
return Binary(result['Body'].read())
except Exception as ex: except Exception as ex:
source.critical("can't retrive S3 object %s: %s", value, ex) source.critical("can't retrive S3 object %s: %s", value, ex)
return None return None
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