当前位置: 首页>>代码示例>>Python>>正文


Python stevedore.NamedExtensionManager方法代码示例

本文整理汇总了Python中stevedore.NamedExtensionManager方法的典型用法代码示例。如果您正苦于以下问题:Python stevedore.NamedExtensionManager方法的具体用法?Python stevedore.NamedExtensionManager怎么用?Python stevedore.NamedExtensionManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stevedore的用法示例。


在下文中一共展示了stevedore.NamedExtensionManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import stevedore [as 别名]
# 或者: from stevedore import NamedExtensionManager [as 别名]
def __init__(self, *args, **kwargs):
        super(Healthcheck, self).__init__(*args, **kwargs)
        self.oslo_conf.register_opts(opts.HEALTHCHECK_OPTS,
                                     group='healthcheck')
        self._path = self._conf_get('path')
        self._show_details = self._conf_get('detailed')
        self._backends = stevedore.NamedExtensionManager(
            self.NAMESPACE, self._conf_get('backends'),
            name_order=True, invoke_on_load=True,
            invoke_args=(self.oslo_conf, self.conf))
        self._accept_to_functor = collections.OrderedDict([
            # Order here matters...
            ('text/plain', self._make_text_response),
            ('text/html', self._make_html_response),
            ('application/json', self._make_json_response),
        ])
        self._accept_order = tuple(self._accept_to_functor)
        # When no accept type matches instead of returning 406 we will
        # always return text/plain (because sending an error from this
        # middleware actually can cause issues).
        self._default_accept = 'text/plain'
        self._ignore_path = False 
开发者ID:openstack,项目名称:oslo.middleware,代码行数:24,代码来源:__init__.py

示例2: processing_hooks_manager

# 需要导入模块: import stevedore [as 别名]
# 或者: from stevedore import NamedExtensionManager [as 别名]
def processing_hooks_manager(*args):
    """Create a Stevedore extension manager for processing hooks.

    :param args: arguments to pass to the hooks constructor.
    """
    global _HOOKS_MGR
    if _HOOKS_MGR is None:
        names = [x.strip()
                 for x in CONF.processing.processing_hooks.split(',')
                 if x.strip()]
        _HOOKS_MGR = stevedore.NamedExtensionManager(
            'ironic_inspector.hooks.processing',
            names=names,
            invoke_on_load=True,
            invoke_args=args,
            on_missing_entrypoints_callback=missing_entrypoints_callback,
            name_order=True)
    return _HOOKS_MGR 
开发者ID:openstack,项目名称:ironic-inspector,代码行数:20,代码来源:base.py

示例3: load

# 需要导入模块: import stevedore [as 别名]
# 或者: from stevedore import NamedExtensionManager [as 别名]
def load(self, *args, **kwargs):
        mgr = stevedore.NamedExtensionManager(
            'dragonflow.controller.apps',
            self.apps_list,
            invoke_on_load=True,
            invoke_args=args,
            invoke_kwds=kwargs,
        )

        for ext in mgr:
            self.apps[ext.name] = ext.obj 
开发者ID:openstack,项目名称:dragonflow,代码行数:13,代码来源:dispatcher.py

示例4: _get_app_class

# 需要导入模块: import stevedore [as 别名]
# 或者: from stevedore import NamedExtensionManager [as 别名]
def _get_app_class(self, app_type):
        """Get an application class (Python class) by app name"""
        mgr = stevedore.NamedExtensionManager(
            'dragonflow.controller.apps',
            [app_type],
            invoke_on_load=False,
        )
        for ext in mgr:
            return ext.plugin
        else:
            raise RuntimeError(_('Failed to load app {0}').format(app_type)) 
开发者ID:openstack,项目名称:dragonflow,代码行数:13,代码来源:datapath.py

示例5: threshold_evaluators

# 需要导入模块: import stevedore [as 别名]
# 或者: from stevedore import NamedExtensionManager [as 别名]
def threshold_evaluators(self):
        if not self._threshold_evaluators:
            threshold_types = ('ceilometer',
                               'gnocchi_resources_threshold',
                               'gnocchi_aggregation_by_metrics_threshold',
                               'gnocchi_aggregation_by_resources_threshold')
            self._threshold_evaluators = stevedore.NamedExtensionManager(
                'aodh.evaluator', threshold_types, invoke_on_load=True,
                invoke_args=(self.conf,))
        return self._threshold_evaluators 
开发者ID:openstack,项目名称:aodh,代码行数:12,代码来源:composite.py


注:本文中的stevedore.NamedExtensionManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。