heat.common.plugin_loader module

Utilities to dynamically load plugin modules.

Modules imported this way remain accessible to static imports, regardless of the order in which they are imported. For modules that are not part of an existing package tree, use create_subpackage() to dynamically create a package for them before loading them.

heat.common.plugin_loader.create_subpackage(path, parent_package_name, subpackage_name='plugins')[source]

Dynamically create a package into which to load plugins.

This allows us to not include an __init__.py in the plugins directory. We must still create a package for plugins to go in, otherwise we get warning messages during import. This also provides a convenient place to store the path(s) to the plugins directory.

heat.common.plugin_loader.load_modules(package, ignore_error=False)[source]

Dynamically load all modules from a given package.