'Initialise the Heat Engine plugin package, and any others.
The heat.engine.plugins package is always created, if it does not
exist, from the plugin directories specified in the config file, and
searched for modules. In addition, any extra packages specified are
also searched for modules. e.g.
>>> PluginManager(\'heat.engine.resources\')
will load all modules in the heat.engine.resources package as well as
any user-supplied plugin modules.'

def __init__(self, *extra_packages):

    def packages():
        for package_name in extra_packages:
            (yield sys.modules[package_name])
        cfg.CONF.import_opt('plugin_dirs', 'heat.common.config')
        (yield plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine'))
    def modules():
        pkg_modules = six.moves.map(plugin_loader.load_modules, packages())
        return itertools.chain.from_iterable(pkg_modules)
    self.modules = list(modules())
