[ckan-dev] lib/cli.py and imports

Toby Dacre toby.okfn at gmail.com
Fri Feb 15 13:38:37 UTC 2013


Hi,

lib/cli.py

has the following comment in the head of the file

#NB No CKAN imports are allowed until after the config file is loaded.
#   i.e. do the imports in methods, after _load_config is called.
#   Otherwise loggers get disabled.

There is also an assert in _load_config

        assert 'ckan' not in dir() # otherwise loggers would be disabled
        # We have now loaded the config. Now we can import ckan for the
        # first time.

a) the assert does not seem to actually do what it thinks it does
b) what is the problem with the logging that is caused.

I think this may be an old problem that has been fixed by code cleanups
that have occurred - at least if I import ckan.model as model in the top of
the file all seems to work as expected as well as logging happening - in at
least some places.

does anyone know more details of this issue?

cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130215/b9e6fca8/attachment.html>


More information about the ckan-dev mailing list