mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 07:29:39 +00:00
Storage/S3: Fix open() method
This commit is contained in:
parent
9f9fb6a85d
commit
ef06b214b2
@ -106,8 +106,9 @@ class S3Storage(Storage):
|
||||
raise StorageError('A bucket secret is required when using dynamic bucket names')
|
||||
|
||||
def open(self, file_id):
|
||||
bucket, id_ = file_id.split('//', 1)
|
||||
try:
|
||||
s3_object = self.client.get_object(Bucket=self._get_current_bucket_name(), Key=file_id)['Body']
|
||||
s3_object = self.client.get_object(Bucket=bucket, Key=id_)['Body']
|
||||
return BytesIO(s3_object.read())
|
||||
except Exception as e:
|
||||
raise StorageError('Could not open "{}": {}'.format(file_id, e)), None, sys.exc_info()[2]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user