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

Python extensions.append_api_extensions_path函数代码示例

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

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



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

示例1: __init__

 def __init__(self):
     super(NuagePlugin, self).__init__()
     neutron_extensions.append_api_extensions_path(extensions.__path__)
     config.nuage_register_cfg_opts()
     self.nuageclient_init()
     net_partition = cfg.CONF.RESTPROXY.default_net_partition_name
     self._create_default_net_partition(net_partition)
开发者ID:PFZheng,项目名称:neutron,代码行数:7,代码来源:plugin.py


示例2: __init__

    def __init__(self, server_timeout=None):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)

        # Include the BigSwitch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {'get_ports': True,
                                               'get_floating_ips': True,
                                               'get_routers': True}

        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )

        # setup rpc for security and DHCP agents
        self._setup_rpc()

        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        LOG.debug(_("NeutronRestProxyV2: initialization done"))
开发者ID:dobriak,项目名称:neutron,代码行数:30,代码来源:plugin.py


示例3: __init__

    def __init__(self):

        ndb.initialize()
        self.ofc = ofc_manager.OFCManager()
        self.base_binding_dict = self._get_base_binding_dict()
        portbindings_base.register_port_dict_function()

        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.setup_rpc()
        self.l3_rpc_notifier = nec_router.L3AgentNotifyAPI()

        self.network_scheduler = importutils.import_object(
            config.CONF.network_scheduler_driver
        )
        self.router_scheduler = importutils.import_object(
            config.CONF.router_scheduler_driver
        )

        nec_router.load_driver(self, self.ofc)
        self.port_handlers = {
            'create': {
                const.DEVICE_OWNER_ROUTER_GW: self.create_router_port,
                const.DEVICE_OWNER_ROUTER_INTF: self.create_router_port,
                'default': self.activate_port_if_ready,
            },
            'delete': {
                const.DEVICE_OWNER_ROUTER_GW: self.delete_router_port,
                const.DEVICE_OWNER_ROUTER_INTF: self.delete_router_port,
                'default': self.deactivate_port,
            }
        }
开发者ID:ChengZuo,项目名称:neutron,代码行数:32,代码来源:nec_plugin.py


示例4: __init__

    def __init__(self, server_timeout=None):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())
        pl_config.register_config()

        # Include the BigSwitch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)

        # init dhcp support
        self.topic = topics.PLUGIN
        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )
        self._dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
        self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
            self._dhcp_agent_notifier
        )
        self.conn = rpc.create_connection(new=True)
        self.callbacks = RpcProxy()
        self.dispatcher = self.callbacks.create_rpc_dispatcher()
        self.conn.create_consumer(self.topic, self.dispatcher,
                                  fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        LOG.debug(_("NeutronRestProxyV2: initialization done"))
开发者ID:yuhui7red,项目名称:neutron,代码行数:34,代码来源:plugin.py


示例5: __init__

    def __init__(self):
        super(MidonetL3ServicePlugin, self).__init__()

        # Instantiate MidoNet API client
        self.client = c_base.load_client(cfg.CONF.MIDONET)

        neutron_extensions.append_api_extensions_path(extensions.__path__)
开发者ID:midonet,项目名称:networking-midonet,代码行数:7,代码来源:l3_midonet.py


示例6: __init__

 def __init__(self):
     # Dynamically change the validators so that they are applicable to
     # the MidoNet implementation of L2GW.
     l2gw_validators.validate_gwdevice_list = (l2gw_midonet_validators.
                                               validate_gwdevice_list)
     neutron_extensions.append_api_extensions_path(l2gateway_ext.__path__)
     super(MidonetL2GatewayPlugin, self).__init__()
开发者ID:yo-iura,项目名称:networking-midonet,代码行数:7,代码来源:plugin.py


示例7: __init__

 def __init__(self):
     extensions.append_api_extensions_path(extensions_pkg.__path__)
     super(ApicL3ServicePlugin, self).__init__()
     self.synchronizer = None
     # NB(tbachman): the mechanism driver depends on the existence
     # of the _apic_driver member. If this member is changed or
     # deleted, the code in the mechanism driver should be changed
     # as well.
     self._apic_driver = apic_driver.ApicL3Driver(self)
开发者ID:noironetworks,项目名称:apic-ml2-driver,代码行数:9,代码来源:l3_apic.py


示例8: __init__

    def __init__(self):
        super(MidonetL3ServicePlugin, self).__init__()

        # Instantiate MidoNet API client
        self.client = c_base.load_client(cfg.CONF.MIDONET)

        # Avoid any side effect from DVR getting set to true
        cfg.CONF.set_override("router_distributed", False)
        neutron_extensions.append_api_extensions_path(extensions.__path__)
开发者ID:gayatrihk,项目名称:networking-midonet,代码行数:9,代码来源:l3_midonet.py


示例9: __init__

 def __init__(self):
     super(NuageFWaaSPlugin, self).__init__()
     from neutron.api import extensions as neutron_extensions
     from neutron_fwaas import extensions
     neutron_extensions.append_api_extensions_path(extensions.__path__)
     self.agent_rpc = NuageNoOpAgent()
     enterprise_name = cfg.CONF.RESTPROXY.default_net_partition_name
     netpart_db = nuagedb.get_net_partition_by_name(db_api.get_session(),
                                                    enterprise_name)
     self.enterprise_id = netpart_db.id
开发者ID:nuagenetworks,项目名称:nuage-openstack-neutron,代码行数:10,代码来源:fwaas_plugin.py


示例10: setUp

 def setUp(self):
     extensions.append_api_extensions_path(dr_extensions.__path__)
     service_plugins = {ext_bgp.BGP_EXT_ALIAS: BGP_PLUGIN}
     super(TestNSXvBgpPlugin, self).setUp(service_plugins=service_plugins)
     self.bgp_plugin = bgp_plugin.NSXvBgpPlugin()
     self.nsxv_driver = self.bgp_plugin.drivers['nsx-v']
     self.nsxv_driver._validate_gateway_network = mock.Mock()
     self.nsxv_driver._validate_bgp_configuration_on_peer_esg = (
         mock.Mock())
     self.plugin = directory.get_plugin()
     self.l3plugin = self.plugin
     self.plugin.init_is_complete = True
     self.context = context.get_admin_context()
     self.project_id = 'dummy_project'
开发者ID:openstack,项目名称:vmware-nsx,代码行数:14,代码来源:test_nsxv_bgp_driver.py


示例11: __init__

    def __init__(self):
        """Load the model class."""
        self._model_name = config.CISCO.model_class
        self._model = importutils.import_object(self._model_name)
        native_bulk_attr_name = ("_%s__native_bulk_support"
                                 % self._model.__class__.__name__)
        self.__native_bulk_support = getattr(self._model,
                                             native_bulk_attr_name, False)

        neutron_extensions.append_api_extensions_path(extensions.__path__)

        # Extend the fault map
        self._extend_fault_map()

        LOG.debug("Plugin initialization complete")
开发者ID:Akanksha08,项目名称:neutron,代码行数:15,代码来源:network_plugin.py


示例12: __init__

    def __init__(self):
        super(NsxDvsV2, self).__init__()
        config.validate_config_options()
        LOG.debug('Driver support: DVS: %s' % dvs_utils.dvs_is_enabled())
        neutron_extensions.append_api_extensions_path([vmware.NSX_EXT_PATH])
        self._dvs = dvs.DvsManager()

        # Common driver code
        self.base_binding_dict = {
            pbin.VIF_TYPE: pbin.VIF_TYPE_DVS,
            pbin.VIF_DETAILS: {
                # TODO(rkukura): Replace with new VIF security details
                pbin.CAP_PORT_FILTER:
                'security-group' in self.supported_extension_aliases}}

        self.setup_dhcpmeta_access()
开发者ID:yxdh,项目名称:vmware-nsx,代码行数:16,代码来源:dvs.py


示例13: setUp

    def setUp(self):
        # Enable the test mechanism driver to ensure that
        # we can successfully call through to all mechanism
        # driver apis.
        cfg.CONF.set_override('mechanism_drivers',
                ['logger_plus', 'test'], group='ml2')
        cfg.CONF.set_override('network_vlan_ranges',
                ['physnet1:1000:1099'], group='ml2_type_vlan')

        extensions.append_api_extensions_path(
            gbpservice.neutron.extensions.__path__)
        super(Ml2PlusPluginV2TestCase, self).setUp(PLUGIN_NAME)
        ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
        self.ext_api = test_extensions.setup_extensions_middleware(ext_mgr)
        self.port_create_status = 'DOWN'
        self.plugin = directory.get_plugin()
开发者ID:openstack,项目名称:group-based-policy,代码行数:16,代码来源:test_plugin.py


示例14: setUp

    def setUp(self, core_plugin=None, sc_plugin=None, service_plugins=None,
              ext_mgr=None):
        extensions.append_api_extensions_path(gbp.neutron.extensions.__path__)
        if not sc_plugin:
            sc_plugin = DB_GP_PLUGIN_KLASS
        self.plugin = importutils.import_object(sc_plugin)
        if not service_plugins:
            service_plugins = {'sc_plugin_name': sc_plugin}

        super(ServiceChainDbTestCase, self).setUp(
            plugin=core_plugin, ext_mgr=ext_mgr,
            service_plugins=service_plugins
        )

        if not ext_mgr:
            ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
            self.ext_api = test_extensions.setup_extensions_middleware(ext_mgr)
开发者ID:yapengwu,项目名称:group-based-policy,代码行数:17,代码来源:test_servicechain_db.py


示例15: __init__

    def __init__(self):
        """Override initialization to avoid any RPC setup as MidoNet does not
        rely on any agent to implement FWaaS.  Instead, set the rpc handling
        to the _MidonetFirewallDriver class so that it handles the FWaaS update
        events.
        """

        # Register the FWaaS extensions path
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        # Although callbacks are unnecessary in midonet, use FirewallCallbacks
        # because it contains useful methods for DB updates.
        self.callbacks = fw_plugin.FirewallCallbacks(self)
        self.client = c_base.load_client(cfg.CONF.MIDONET)
        self.agent_rpc = _MidonetFirewallDriver(self.client, self.callbacks)
        self.endpoints = [self.callbacks]  # So that tests don't complain
        firewall_db.subscribe()
开发者ID:Prabhat2015,项目名称:networking-midonet,代码行数:17,代码来源:plugin.py


示例16: __init__

    def __init__(self):
        super(MidonetMixinBase, self).__init__()

        # Instantiate MidoNet API client
        self.client = c_base.load_client(cfg.CONF.MIDONET)

        neutron_extensions.append_api_extensions_path(extensions.__path__)
        self.setup_rpc()

        self.base_binding_dict = {
            portbindings.VIF_TYPE: const.VIF_TYPE_MIDONET,
            portbindings.VNIC_TYPE: portbindings.VNIC_NORMAL,
            portbindings.VIF_DETAILS: {
                # TODO(rkukura): Replace with new VIF security details
                portbindings.CAP_PORT_FILTER:
                'security-group' in self.supported_extension_aliases}}
        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )
开发者ID:midonet,项目名称:networking-midonet,代码行数:19,代码来源:plugin.py


示例17: __init__

 def __init__(self):
     self._is_sub_plugin = tvd_utils.is_tvd_core_plugin()
     dvs_utils.dvs_register_exceptions()
     super(NsxDvsV2, self).__init__()
     if self._is_sub_plugin:
         extension_drivers = cfg.CONF.nsx_tvd.dvs_extension_drivers
     else:
         extension_drivers = cfg.CONF.nsx_extension_drivers
     self._extension_manager = nsx_managers.ExtensionManager(
          extension_drivers=extension_drivers)
     LOG.debug('Driver support: DVS: %s' % dvs_utils.dvs_is_enabled())
     self._extension_manager.initialize()
     self.supported_extension_aliases.extend(
         self._extension_manager.extension_aliases())
     neutron_extensions.append_api_extensions_path(
         [vmware_nsx.NSX_EXT_PATH])
     self.cfg_group = 'dvs'  # group name for dvs section in nsx.ini
     self._dvs = dvs.SingleDvsManager()
     self.setup_dhcpmeta_access()
开发者ID:openstack,项目名称:vmware-nsx,代码行数:19,代码来源:plugin.py


示例18: __init__

    def __init__(self):
        """Load the model class."""
        self._model = importutils.import_object(config.CISCO.model_class)
        if hasattr(self._model, "MANAGE_STATE") and self._model.MANAGE_STATE:
            self._master = False
            LOG.debug(_("Model %s manages state"), config.CISCO.model_class)
            native_bulk_attr_name = ("_%s__native_bulk_support"
                                     % self._model.__class__.__name__)
            self.__native_bulk_support = getattr(self._model,
                                                 native_bulk_attr_name, False)

        if hasattr(self._model, "supported_extension_aliases"):
            self.supported_extension_aliases.extend(
                self._model.supported_extension_aliases)

        neutron_extensions.append_api_extensions_path(extensions.__path__)

        # Extend the fault map
        self._extend_fault_map()

        LOG.debug(_("Plugin initialization complete"))
开发者ID:Karbit,项目名称:neutron,代码行数:21,代码来源:network_plugin.py


示例19: __init__

    def __init__(self):
        super(NECPluginV2Impl, self).__init__()
        self.ofc = ofc_manager.OFCManager(self.safe_reference)
        self.l2mgr = l2manager.L2Manager(self.safe_reference)
        self.base_binding_dict = self._get_base_binding_dict()
        portbindings_base.register_port_dict_function()

        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.setup_rpc()
        self.l3_rpc_notifier = router_plugin.L3AgentNotifyAPI()

        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )
        self.router_scheduler = importutils.import_object(
            cfg.CONF.router_scheduler_driver
        )

        router_plugin.load_driver(self.safe_reference, self.ofc)
        self.start_periodic_dhcp_agent_status_check()
开发者ID:nec-openstack,项目名称:networking-nec-nwa,代码行数:21,代码来源:plugin.py


示例20: __init__

    def __init__(self):
        super(MidonetMixin, self).__init__()

        # Instantiate MidoNet API client
        conf = cfg.CONF.MIDONET
        neutron_extensions.append_api_extensions_path(extensions.__path__)
        self.api_cli = client.MidonetClient(conf.midonet_uri, conf.username,
                                            conf.password,
                                            project_id=conf.project_id)

        self.setup_rpc()

        self.base_binding_dict = {
            portbindings.VIF_TYPE: portbindings.VIF_TYPE_MIDONET,
            portbindings.VNIC_TYPE: portbindings.VNIC_NORMAL,
            portbindings.VIF_DETAILS: {
                # TODO(rkukura): Replace with new VIF security details
                portbindings.CAP_PORT_FILTER:
                'security-group' in self.supported_extension_aliases}}
        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )
开发者ID:midonet,项目名称:python-neutron-plugin-midonet,代码行数:22,代码来源:plugin.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python extensions.get_extensions_path函数代码示例发布时间:2022-05-27
下一篇:
Python api_common.list_args函数代码示例发布时间: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