def _load_global_resources(env): import sys from heat.common import plugin_loader # load plugin modules _register_modules(env, plugin_loader.load_modules(sys.modules[__name__])) cfg.CONF.import_opt('plugin_dirs', 'heat.common.config') plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine') _register_modules(env, plugin_loader.load_modules(plugin_pkg, True))
def _initialise(): import sys from heat.common import plugin_loader _register_modules(plugin_loader.load_modules(sys.modules[__name__])) from heat.openstack.common import cfg plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine') _register_modules(plugin_loader.load_modules(plugin_pkg, True))
def _initialise(): import sys from heat.common import plugin_loader _register_modules(plugin_loader.load_modules(sys.modules[__name__])) from oslo.config import cfg plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine') _register_modules(plugin_loader.load_modules(plugin_pkg, True))
def test_load_modules_skip_setup(self, mp): importer = pkgutil.ImpImporter(heat.engine.__path__[0]) mp.return_value = ((importer, "hola.foo", None), (importer, "hola.setup", None)) loaded = plugin_loader.load_modules(heat.engine, ignore_error=True) self.assertEqual(1, len(list(loaded)))
def _global_modules(): ''' Returns all core and plugin resource modules in Heat. Core resource modules are yielded first to allow plugin modules to override them if desired. ''' import sys from heat.common import plugin_loader cfg.CONF.import_opt('plugin_dirs', 'heat.common.config') plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine') yield __name__, plugin_loader.load_modules(sys.modules[__name__]) yield plugin_pkg.__name__, plugin_loader.load_modules(plugin_pkg, True)
def initialise(): global _initialized if _initialized: return import sys from heat.common import plugin_loader _register_modules(plugin_loader.load_modules(sys.modules[__name__])) from oslo.config import cfg cfg.CONF.import_opt('plugin_dirs', 'heat.common.config') plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine') _register_modules(plugin_loader.load_modules(plugin_pkg, True)) _initialized = True
def initialise(): global _environment if _environment is not None: return import sys from oslo.config import cfg from heat.common import plugin_loader _environment = environment.Environment({}, user_env=False) cfg.CONF.import_opt('environment_dir', 'heat.common.config') _load_global_environment(cfg.CONF.environment_dir) _register_modules(plugin_loader.load_modules(sys.modules[__name__])) cfg.CONF.import_opt('plugin_dirs', 'heat.common.config') plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs, 'heat.engine') _register_modules(plugin_loader.load_modules(plugin_pkg, True)) _initialized = True