ckan / ckanext-archiver

Archive CKAN resources
MIT License
21 stars 46 forks source link

Support for old ckan releases breaks compatibility with CKAN 2.3+ #17

Closed mostrovoi closed 8 years ago

mostrovoi commented 8 years ago

Current implementation claims to support CKAN 2.1 and above that. Therefore it is taken into account the presence of ResourceGroup to check what CKAN version we are running:

https://github.com/ckan/ckanext-archiver/blob/master/ckanext/archiver/commands.py#L181

However this check is not done in all places and newer CKAN versions fail to work for some paster commands (e.g: update, migrate-archive-dirs:)

https://github.com/ckan/ckanext-archiver/blob/master/ckanext/archiver/commands.py#L200 https://github.com/ckan/ckanext-archiver/blob/master/ckanext/archiver/commands.py#L389

In ckanext-qa we find the same problem in commands.py:

https://github.com/ckan/ckanext-qa/blob/master/ckanext/qa/commands.py#L155

I would also advise to use the same check for all the places. Sometimes the following check is used: if p.toolkit.check_ckan_version(max_version='2.2.99'): whereas in some other places is used the following check: if hasattr(model, 'ResourceGroup'):

I can make a pull request regarding this if I find the time

mostrovoi commented 8 years ago

Done: https://github.com/ckan/ckanext-archiver/pull/18

davidread commented 8 years ago

Closed by #18