ckan / ckanext-dcat

CKAN ♥ DCAT
164 stars 142 forks source link

Command line interface not working with ckan 2.9 and python 2.8 #219

Open javicond3 opened 2 years ago

javicond3 commented 2 years ago

The CLI commands do not work with ckan >= 2.9 and python >= 2.8.

The problem is related to ckan.plugins.toolkit.CkanCommandthat is deprecated

amercader commented 2 years ago

On CKAN>=2.9 you need to use the ckan command instead of the paster one:

ckan -c ../ckan/ckan.ini generate-static json out.json

The command runs but I see that it is currently broken:

  File "/home/adria/dev/pyenvs/ckan-py3/src/ckanext-dcat/ckanext/dcat/cli.py", line 21, in json
    utils.generate_static_json(output)
  File "/home/adria/dev/pyenvs/ckan-py3/src/ckanext-dcat/ckanext/dcat/utils.py", line 370, in generate_static_json
    toolkit.get_action('dcat_datasets_list')({},
  File "/home/adria/dev/pyenvs/ckan-py3/src/ckan/ckan/logic/__init__.py", line 445, in get_action
    raise KeyError("Action '%s' not found" % action)
KeyError: "Action 'dcat_datasets_list' not found"

I'm not familiar with this command's expected behaviour and its implementation but if you need it perhaps you can have a go at fixing it?

javicond3 commented 2 years ago

Thanks for the answer @amercader I will try to fix it.