Comment 4 for bug 1292655

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 1292655] Re: heat engine plugins require their test dependencies to be installed to load

+1

Excerpts from Tomas Sedovic's message of 2014-04-01 12:54:05 UTC:
> I'm not fond of blacklisting hardcoded parts of the module path.
>
> How about we modify the importer to look at package's `__all__` variable
> and ignore anything that isn't listed there? If __all__ is missing, we'd
> revert to the current behaviour.
>
> For example with this plugin structure:
>
> myplugin/
> __init__.py
> foo.py
> bar.py
> tests/
> __init__.py
> test_foo.py
> test_bar.py
>
>
> if myplugin/__init__.py contained this:
>
> __all__ = ['foo', 'bar']
>
> Heat would load the `myplugin.foo` and `myplugin.bar` modules, ignoring
> everything else. If there were no `__all__` variable, we would load
> everything just as we do today.
>
> This puts the control of what should and shouldn't be loaded to the
> plugin authors (who should know this best). And it uses a Python feature
> the package authors are already familiar with.
>
> --
> You received this bug notification because you are subscribed to heat.
> https://bugs.launchpad.net/bugs/1292655
>
> Title:
> heat engine plugins require their test dependencies to be installed to
> load
>
> Status in Orchestration API (Heat):
> In Progress
>
> Bug description:
> The heat engine plugin manager attempts to recurisvely load all
> modules in a plugin. If a plugin has tests, the plugin manager will
> try to load them and if the test dependencies aren't installed then
> heat-engine will fail to start. It should be possible to load a plugin
> without requiring test dependencies to be installed.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/heat/+bug/1292655/+subscriptions