TkTech / ckanext-cloudstorage

Implements support for resource storage against multiple popular providers via apache-libcloud (S3, Azure Storage, etc...)
MIT License
35 stars 55 forks source link

Add CKAN 2.8 support #35

Closed Zharktas closed 4 years ago

Zharktas commented 5 years ago

CKAN 2.8 migrated api to flask and file handling was changed https://github.com/ckan/ckan/pull/3884. This PR ports the change to cloudstorage.

Without it the upload would error with the following log:

Traceback (most recent call last): File "/usr/lib/ckan/default/src/ckan/ckan/views/api.py", line 288, in action result = function(context, request_data) File "/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py", line 464, in wrapped result = _action(context, data_dict, **kw) File "/vagrant/modules/ckanext-cloudstorage/ckanext/cloudstorage/logic/action/multipart.py", line 160, in upload_multipart data=bytearray(part_content.file.read()) File "/usr/lib/ckan/default/lib/python2.7/site-packages/werkzeug/datastructures.py", line 2745, in __getattr__ return getattr(self.stream, name) AttributeError: SpooledTemporaryFile instance has no attribute 'file'

hammadhasandogar commented 5 years ago

@Zharktas did you find any solution to that?

amercader commented 4 years ago

@TkTech I know you mentioned plans for a new version of this extension but what do you think about merging this in order to support CKAN 2.8 (and 2.9) in the meantime?

TkTech commented 4 years ago

Can you test this @amercader? I'm unable to work on this at the moment. Needs another +1 before I merge it.

(Also just really needs tests in general...)

amercader commented 4 years ago

@TkTech yes, we've been using this patch in a project for months now and it works well, so +1 from me