mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 07:29:39 +00:00
Storage/S3: Add md5 checksum
This commit is contained in:
parent
4699f85234
commit
36f8ef06d2
@ -75,8 +75,10 @@ class S3Storage(Storage):
|
||||
|
||||
def save(self, name, content_type, filename, fileobj):
|
||||
try:
|
||||
self.client.upload_fileobj(fileobj, self.bucket, name)
|
||||
return name, ''
|
||||
fileobject = self._ensure_fileobj(fileobj)
|
||||
self.client.upload_fileobj(fileobject, self.bucket, name)
|
||||
checksum = self.client.head_object(Bucket=self.bucket, Key=name)['ETag'][1:-1]
|
||||
return name, checksum
|
||||
except Exception as e:
|
||||
raise StorageError('Could not save "{}": {}'.format(name, e)), None, sys.exc_info()[2]
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='indico-plugin-storage-s3',
|
||||
version='1.0',
|
||||
version='1.0-dev',
|
||||
description='S3 storage backend for Indico',
|
||||
url='https://github.com/indico/indico-plugins',
|
||||
license='https://www.gnu.org/licenses/gpl-3.0.txt',
|
||||
@ -32,7 +32,7 @@ setup(
|
||||
platforms='any',
|
||||
install_requires=[
|
||||
'indico>=2.0',
|
||||
'boto3>=1.6.5'
|
||||
'boto3>=1.6.16,<2.0'
|
||||
],
|
||||
classifiers=[
|
||||
'Environment :: Plugins',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user