diff --git a/storage_xrootd/indico_storage_xrootd.py b/storage_xrootd/indico_storage_xrootd.py index eea9dbb..cd51cb1 100644 --- a/storage_xrootd/indico_storage_xrootd.py +++ b/storage_xrootd/indico_storage_xrootd.py @@ -97,14 +97,13 @@ class XRootDStorage(Storage): if not fs.exists(basedir): fs.makedir(basedir, recursive=True, allow_recreate=True) with fs.open(filepath, 'wb') as f: - shutil.copyfileobj(fileobj, f, 1024 * 1024) - return name + checksum = self._copy_file(fileobj, f) + return name, checksum def save(self, name, content_type, filename, fileobj): try: fs = self._get_xrootd_fs() - name = self._save(name, fileobj, fs) - return name + return self._save(name, fileobj, fs) except Exception as e: raise StorageError('Could not save "{}": {}'.format(name, e)), None, sys.exc_info()[2] @@ -158,7 +157,6 @@ class EOSStorage(XRootDStorage): # object which does not have seek/tell methods. size_hint = current_app.config['MAX_CONTENT_LENGTH'] if current_app else None fs = self._get_xrootd_fs(size=size_hint) - name = self._save(name, fileobj, fs) - return name + return self._save(name, fileobj, fs) except Exception as e: raise StorageError('Could not save "{}": {}'.format(name, e)), None, sys.exc_info()[2] diff --git a/storage_xrootd/setup.py b/storage_xrootd/setup.py index 3b6b8c8..f5b3b33 100644 --- a/storage_xrootd/setup.py +++ b/storage_xrootd/setup.py @@ -18,9 +18,10 @@ from __future__ import unicode_literals from setuptools import setup + setup( name='indico_storage_xrootd', - version='0.1.1', + version='0.1.2', url='https://github.com/indico/indico-plugins', license='https://www.gnu.org/licenses/gpl-3.0.txt', author='Indico Team', @@ -29,7 +30,7 @@ setup( zip_safe=False, platforms='any', install_requires=[ - 'indico>=1.9.10', + 'indico>=1.9.11.dev16', 'xrootdpyfs==0.1.5', ], classifiers=[