• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python config.load_paste_app函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中neutron.common.config.load_paste_app函数的典型用法代码示例。如果您正苦于以下问题:Python load_paste_app函数的具体用法?Python load_paste_app怎么用?Python load_paste_app使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: setUp

    def setUp(self):
        super(ExtensionExtendedAttributeTestCase, self).setUp()
        plugin = (
            "neutron.tests.unit.api.test_extensions."
            "ExtensionExtendedAttributeTestPlugin"
        )

        # point config file to: neutron/tests/etc/neutron.conf
        self.config_parse()

        self.setup_coreplugin(plugin)

        ext_mgr = extensions.PluginAwareExtensionManager(
            extensions_path,
            {lib_const.CORE: ExtensionExtendedAttributeTestPlugin()}
        )
        ext_mgr.extend_resources("2.0", {})
        extensions.PluginAwareExtensionManager._instance = ext_mgr

        app = config.load_paste_app('extensions_test_app')
        self._api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)

        self._tenant_id = "8c70909f-b081-452d-872b-df48e6c355d1"

        self.agentscheduler_dbMinxin = directory.get_plugin()

        quota.QUOTAS._driver = None
        cfg.CONF.set_override('quota_driver', 'neutron.quota.ConfDriver',
                              group='QUOTAS')
开发者ID:igordcard,项目名称:neutron,代码行数:29,代码来源:test_extensions.py


示例2: setUp

    def setUp(self):
        super(ExtensionExtendedAttributeTestCase, self).setUp()
        plugin = "neutron.tests.unit.test_extension_extended_attribute." "ExtensionExtendedAttributeTestPlugin"

        # point config file to: neutron/tests/etc/neutron.conf.test
        self.config_parse()

        self.setup_coreplugin(plugin)

        ext_mgr = extensions.PluginAwareExtensionManager(
            extensions_path, {constants.CORE: ExtensionExtendedAttributeTestPlugin}
        )
        ext_mgr.extend_resources("2.0", {})
        extensions.PluginAwareExtensionManager._instance = ext_mgr

        app = config.load_paste_app("extensions_test_app")
        self._api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)

        self._tenant_id = "8c70909f-b081-452d-872b-df48e6c355d1"
        # Save the global RESOURCE_ATTRIBUTE_MAP
        self.saved_attr_map = {}
        for resource, attrs in attributes.RESOURCE_ATTRIBUTE_MAP.iteritems():
            self.saved_attr_map[resource] = attrs.copy()
        # Add the resources to the global attribute map
        # This is done here as the setup process won't
        # initialize the main API router which extends
        # the global attribute map
        attributes.RESOURCE_ATTRIBUTE_MAP.update(extattr.EXTENDED_ATTRIBUTES_2_0)
        self.agentscheduler_dbMinxin = manager.NeutronManager.get_plugin()
        self.addCleanup(self.restore_attribute_map)

        quota.QUOTAS._driver = None
        cfg.CONF.set_override("quota_driver", "neutron.quota.ConfDriver", group="QUOTAS")
开发者ID:waltBB,项目名称:neutron_read,代码行数:33,代码来源:test_extension_extended_attribute.py


示例3: setUp

    def setUp(self):
        super(QuotaExtensionTestCase, self).setUp()
        # Ensure existing ExtensionManager is not used
        extensions.PluginAwareExtensionManager._instance = None

        self.useFixture(tools.AttributeMapMemento())

        # Create the default configurations
        self.config_parse()

        # Update the plugin and extensions path
        self.setup_coreplugin(TARGET_PLUGIN)
        cfg.CONF.set_override(
            'quota_items',
            ['network', 'subnet', 'port', 'extra1'],
            group='QUOTAS')
        quota.QUOTAS = quota.QuotaEngine()
        quota.register_resources_from_config()
        self._plugin_patcher = mock.patch(TARGET_PLUGIN, autospec=True)
        self.plugin = self._plugin_patcher.start()
        self.plugin.return_value.supported_extension_aliases = ['quotas']
        # QUOTAS will register the items in conf when starting
        # extra1 here is added later, so have to do it manually
        resource_registry.register_resource_by_name('extra1')
        ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
        app = config.load_paste_app('extensions_test_app')
        ext_middleware = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
        self.api = webtest.TestApp(ext_middleware)
        # Initialize the router for the core API in order to ensure core quota
        # resources are registered
        router.APIRouter()
开发者ID:HoratiusTang,项目名称:neutron,代码行数:31,代码来源:test_quotasv2.py


示例4: setUp

    def setUp(self):
        super(RouterServiceInsertionTestCase, self).setUp()
        plugin = (
            "neutron.tests.unit.test_routerserviceinsertion."
            "RouterServiceInsertionTestPlugin"
        )

        # point config file to: neutron/tests/etc/neutron.conf.test
        args = ['--config-file', test_api_v2.etcdir('neutron.conf.test')]
        config.parse(args=args)

        #just stubbing core plugin with LoadBalancer plugin
        self.setup_coreplugin(plugin)
        cfg.CONF.set_override('service_plugins', [])
        cfg.CONF.set_override('quota_router', -1, group='QUOTAS')
        self.addCleanup(cfg.CONF.reset)

        # Ensure existing ExtensionManager is not used

        ext_mgr = extensions.PluginAwareExtensionManager(
            extensions_path,
            {constants.LOADBALANCER: RouterServiceInsertionTestPlugin()}
        )
        extensions.PluginAwareExtensionManager._instance = ext_mgr
        router.APIRouter()

        app = config.load_paste_app('extensions_test_app')
        self._api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)

        self._tenant_id = "8c70909f-b081-452d-872b-df48e6c355d1"

        self._service_type_id = _uuid()

        self._setup_core_resources()
开发者ID:Doude,项目名称:neutron,代码行数:34,代码来源:test_routerserviceinsertion.py


示例5: setUp

 def setUp(self, core_plugin=None, flowclassifier_plugin=None,
           ext_mgr=None):
     mock_log_p = mock.patch.object(fdb, 'LOG')
     self.mock_log = mock_log_p.start()
     cfg.CONF.register_opts(fc_ext.flow_classifier_quota_opts, 'QUOTAS')
     if not flowclassifier_plugin:
         flowclassifier_plugin = DB_FLOWCLASSIFIER_PLUGIN_CLASS
     service_plugins = {
         fc_ext.FLOW_CLASSIFIER_EXT: flowclassifier_plugin
     }
     fdb.FlowClassifierDbPlugin.supported_extension_aliases = [
         fc_ext.FLOW_CLASSIFIER_EXT]
     fdb.FlowClassifierDbPlugin.path_prefix = (
         fc_ext.FLOW_CLASSIFIER_PREFIX
     )
     super(FlowClassifierDbPluginTestCase, self).setUp(
         ext_mgr=ext_mgr,
         plugin=core_plugin,
         service_plugins=service_plugins
     )
     if not ext_mgr:
         self.flowclassifier_plugin = importutils.import_object(
             flowclassifier_plugin)
         ext_mgr = api_ext.PluginAwareExtensionManager(
             extensions_path,
             {fc_ext.FLOW_CLASSIFIER_EXT: self.flowclassifier_plugin}
         )
         app = config.load_paste_app('extensions_test_app')
         self.ext_api = api_ext.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:jiangxilong,项目名称:networking-sfc,代码行数:29,代码来源:test_flowclassifier_db.py


示例6: setUp

    def setUp(self):
        super(DetailQuotaExtensionTestCase, self).setUp()
        # Ensure existing ExtensionManager is not used
        extensions.PluginAwareExtensionManager._instance = None

        self.useFixture(fixture.APIDefinitionFixture())

        # Create the default configurations
        self.config_parse()

        # Update the plugin and extensions path
        self.setup_coreplugin('ml2')
        quota.QUOTAS = quota.QuotaEngine()
        self._plugin_patcher = mock.patch(TARGET_PLUGIN, autospec=True)
        self.plugin = self._plugin_patcher.start()
        self.plugin.return_value.supported_extension_aliases = \
            ['quotas', 'quota_details']
        # QUOTAS will register the items in conf when starting
        ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
        app = config.load_paste_app('extensions_test_app')
        ext_middleware = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
        self.api = webtest.TestApp(ext_middleware)
        # Initialize the router for the core API in order to ensure core quota
        # resources are registered
        router.APIRouter()
开发者ID:cubeek,项目名称:neutron,代码行数:25,代码来源:test_quotasv2_detail.py


示例7: setUp

    def setUp(self):
        super(QuotaExtensionTestCase, self).setUp()
        # Ensure existing ExtensionManager is not used
        extensions.PluginAwareExtensionManager._instance = None

        # Save the global RESOURCE_ATTRIBUTE_MAP
        self.saved_attr_map = {}
        for resource, attrs in attributes.RESOURCE_ATTRIBUTE_MAP.iteritems():
            self.saved_attr_map[resource] = attrs.copy()

        # Create the default configurations
        self.config_parse()

        # Update the plugin and extensions path
        self.setup_coreplugin(TARGET_PLUGIN)
        cfg.CONF.set_override(
            'quota_items',
            ['network', 'subnet', 'port', 'extra1'],
            group='QUOTAS')
        quota.QUOTAS = quota.QuotaEngine()
        quota.register_resources_from_config()
        self._plugin_patcher = mock.patch(TARGET_PLUGIN, autospec=True)
        self.plugin = self._plugin_patcher.start()
        self.plugin.return_value.supported_extension_aliases = ['quotas']
        # QUOTAS will register the items in conf when starting
        # extra1 here is added later, so have to do it manually
        quota.QUOTAS.register_resource_by_name('extra1')
        ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
        app = config.load_paste_app('extensions_test_app')
        ext_middleware = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
        self.api = webtest.TestApp(ext_middleware)
开发者ID:absolutarin,项目名称:neutron,代码行数:31,代码来源:test_quota_ext.py


示例8: setUp

    def setUp(self):
        flowclassifier_plugin = (
            test_flowclassifier_db.DB_FLOWCLASSIFIER_PLUGIN_CLASS)

        service_plugins = {
            flowclassifier.FLOW_CLASSIFIER_EXT: flowclassifier_plugin
        }
        fdb.FlowClassifierDbPlugin.supported_extension_aliases = [
            flowclassifier.FLOW_CLASSIFIER_EXT]
        fdb.FlowClassifierDbPlugin.path_prefix = (
            flowclassifier.FLOW_CLASSIFIER_PREFIX
        )
        super(OVSFlowClassifierDriverTestCase, self).setUp(
            ext_mgr=None,
            plugin=None,
            service_plugins=service_plugins
        )
        self.flowclassifier_plugin = importutils.import_object(
            flowclassifier_plugin)
        ext_mgr = api_ext.PluginAwareExtensionManager(
            test_flowclassifier_db.extensions_path,
            {
                flowclassifier.FLOW_CLASSIFIER_EXT: self.flowclassifier_plugin
            }
        )
        app = config.load_paste_app('extensions_test_app')
        self.ext_api = api_ext.ExtensionMiddleware(app, ext_mgr=ext_mgr)
        self.ctx = context.get_admin_context()
        self.driver = driver.OVSFlowClassifierDriver()
        self.driver.initialize()
开发者ID:openstack,项目名称:networking-sfc,代码行数:30,代码来源:test_driver.py


示例9: setup_extensions_middleware

def setup_extensions_middleware(extension_manager=None):
    extension_manager = (extension_manager or
                         extensions.PluginAwareExtensionManager(
                             extensions_path,
                             {constants.CORE: FakePluginWithExtension()}))
    base.BaseTestCase.config_parse()
    app = config.load_paste_app('extensions_test_app')
    return extensions.ExtensionMiddleware(app, ext_mgr=extension_manager)
开发者ID:absolutarin,项目名称:neutron,代码行数:8,代码来源:test_extensions.py


示例10: setUp

 def setUp(self):
     service_plugins = {'TAG': "neutron.services.tag.tag_plugin.TagPlugin"}
     super(TestTagApiBase, self).setUp(service_plugins=service_plugins)
     plugin = tag_plugin.TagPlugin()
     ext_mgr = extensions.PluginAwareExtensionManager(
         extensions_path, {'TAG': plugin}
     )
     app = config.load_paste_app('extensions_test_app')
     self.ext_api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:21atlas,项目名称:neutron,代码行数:9,代码来源:test_tag.py


示例11: setUp

    def setUp(self, plugin=None):
        service_plugins = {"metering_plugin_name": DB_METERING_PLUGIN_KLASS}

        super(MeteringPluginDbTestCase, self).setUp(plugin=plugin, service_plugins=service_plugins)

        self.plugin = metering_plugin.MeteringPlugin()
        ext_mgr = extensions.PluginAwareExtensionManager(extensions_path, {constants.METERING: self.plugin})
        app = config.load_paste_app("extensions_test_app")
        self.ext_api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:chrisacbr,项目名称:openstack-neutron,代码行数:9,代码来源:test_db_metering.py


示例12: setup_extensions_middleware

def setup_extensions_middleware(extension_manager=None):
    extension_manager = (extension_manager or
                         extensions.PluginAwareExtensionManager(
                             extensions_path,
                             {constants.CORE: FakePluginWithExtension()}))
    config_file = 'neutron.conf.test'
    args = ['--config-file', etcdir(config_file)]
    config.parse(args=args)
    app = config.load_paste_app('extensions_test_app')
    return extensions.ExtensionMiddleware(app, ext_mgr=extension_manager)
开发者ID:JoeMido,项目名称:neutron,代码行数:10,代码来源:test_extensions.py


示例13: setUp

 def setUp(self):
     svc_plugins = {'plugin_name': PLUGIN_NAME}
     super(TestNetworkIPAvailabilityAPI, self).setUp(
             service_plugins=svc_plugins)
     self.plugin = plugin_module.NetworkIPAvailabilityPlugin()
     ext_mgr = api_ext.PluginAwareExtensionManager(
         EXTENSIONS_PATH, {"network-ip-availability": self.plugin}
     )
     app = config.load_paste_app('extensions_test_app')
     self.ext_api = api_ext.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:21atlas,项目名称:neutron,代码行数:10,代码来源:test_network_ip_availability.py


示例14: _run_wsgi

def _run_wsgi(app_name):
    app = config.load_paste_app(app_name)
    if not app:
        LOG.error(_LE('No known API applications configured.'))
        return
    server = wsgi.Server("Neutron")
    server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host,
                 workers=_get_api_workers())
    LOG.info(_LI("Neutron service started, listening on %(host)s:%(port)s"),
             {'host': cfg.CONF.bind_host, 'port': cfg.CONF.bind_port})
    return server
开发者ID:TonyChengTW,项目名称:OpenStack_Liberty_Control,代码行数:11,代码来源:service.py


示例15: _run_wsgi

def _run_wsgi(app_name):
    app = config.load_paste_app(app_name)
    if not app:
        LOG.error(_LE('No known API applications configured.'))
        return
    app.normalize_url("http://192.168.37.127:9696/v2.0/extensions.json")
    server = wsgi.Server("Neutron")
    server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host,
                 workers=_get_api_workers())
    LOG.info(_LI("Neutron service started, listening on %(host)s:%(port)s"),
             {'host': cfg.CONF.bind_host, 'port': cfg.CONF.bind_port})
    return server
开发者ID:paninetworks,项目名称:neutron,代码行数:12,代码来源:service.py


示例16: _run_wsgi

def _run_wsgi(app_name):
    app = config.load_paste_app(app_name)
    if not app:
        LOG.error(_LE('No known API applications configured.'))
        return
    server = wsgi.Server("Neutron")
    server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host,
                 workers=cfg.CONF.api_workers)
    # Dump all option values here after all options are parsed
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
    LOG.info(_LI("Neutron service started, listening on %(host)s:%(port)s"),
             {'host': cfg.CONF.bind_host, 'port': cfg.CONF.bind_port})
    return server
开发者ID:Intellifora,项目名称:neutron,代码行数:13,代码来源:service.py


示例17: setUp

 def setUp(self):
     service_plugins = {
         'TAG': "neutron.services.tag.tag_plugin.TagPlugin",
         'router':
         "neutron.tests.unit.extensions.test_l3.TestL3NatServicePlugin"}
     super(TestTagApiBase, self).setUp(service_plugins=service_plugins)
     plugin = tag_plugin.TagPlugin()
     l3_plugin = test_l3.TestL3NatServicePlugin()
     ext_mgr = extensions.PluginAwareExtensionManager(
         extensions_path, {'router': l3_plugin, 'TAG': plugin}
     )
     ext_mgr.extend_resources("2.0", attributes.RESOURCE_ATTRIBUTE_MAP)
     app = config.load_paste_app('extensions_test_app')
     self.ext_api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:AradhanaSingh,项目名称:neutron,代码行数:14,代码来源:test_tag.py


示例18: setUp

    def setUp(self, core_plugin=None, fw_plugin=None, ext_mgr=None):
        self.agentapi_delf_p = mock.patch(DELETEFW_PATH, create=True, new=FakeAgentApi().delete_firewall)
        self.agentapi_delf_p.start()
        if not fw_plugin:
            fw_plugin = DB_FW_PLUGIN_KLASS
        service_plugins = {"fw_plugin_name": fw_plugin}

        fdb.Firewall_db_mixin.supported_extension_aliases = ["fwaas"]
        super(FirewallPluginDbTestCase, self).setUp(ext_mgr=ext_mgr, service_plugins=service_plugins)

        if not ext_mgr:
            self.plugin = importutils.import_object(fw_plugin)
            ext_mgr = api_ext.PluginAwareExtensionManager(extensions_path, {constants.FIREWALL: self.plugin})
            app = config.load_paste_app("extensions_test_app")
            self.ext_api = api_ext.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:kbijon,项目名称:OpenStack-CVRM,代码行数:15,代码来源:test_db_firewall.py


示例19: _run_wsgi

def _run_wsgi(app_name):
    LOG.debug(_("Loading paste app %s" % app_name))
    app = config.load_paste_app(app_name)
    if not app:
        LOG.error(_("No known API applications configured."))
        return
    server = wsgi.Server("LBaaS-agent")
    server.start(app, cfg.CONF.agent_bind_port, cfg.CONF.agent_bind_host)
    # Dump all option values here after all options are parsed
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
    LOG.info(_("Loading paste app %s" % app_name))
    LOG.info(
        _("LBaaS-agent service started, listening on %(host)s:%(port)s"),
        {"host": cfg.CONF.agent_bind_host, "port": cfg.CONF.agent_bind_port},
    )
    return server
开发者ID:netscaler,项目名称:neutron,代码行数:16,代码来源:agent_service.py


示例20: setUp

    def setUp(self, core_plugin=None, fw_plugin=None):
        if not fw_plugin:
            fw_plugin = DB_FW_PLUGIN_KLASS
        service_plugins = {'fw_plugin_name': fw_plugin}

        fdb.Firewall_db_mixin.supported_extension_aliases = ["fwaas"]
        super(FirewallPluginDbTestCase, self).setUp(
            service_plugins=service_plugins
        )

        self.plugin = importutils.import_object(fw_plugin)
        ext_mgr = api_ext.PluginAwareExtensionManager(
            extensions_path,
            {constants.FIREWALL: self.plugin}
        )
        app = config.load_paste_app('extensions_test_app')
        self.ext_api = api_ext.ExtensionMiddleware(app, ext_mgr=ext_mgr)
开发者ID:CampHarmony,项目名称:neutron,代码行数:17,代码来源:test_db_firewall.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python config.parse函数代码示例发布时间:2022-05-27
下一篇:
Python config.init函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap