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

Python ovs_neutron_agent.create_agent_config_map函数代码示例

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

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



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

示例1: test_create_agent_config_map_fails_for_invalid_tunnel_config

 def test_create_agent_config_map_fails_for_invalid_tunnel_config(self):
     self.addCleanup(cfg.CONF.reset)
     # An ip address is required for tunneling but there is no default
     cfg.CONF.set_override('tunnel_type', constants.TYPE_GRE,
                           group='AGENT')
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:CiscoSystems,项目名称:quantum,代码行数:7,代码来源:test_ovs_neutron_agent.py


示例2: test_create_agent_config_map_fails_for_invalid_tunnel_config

 def test_create_agent_config_map_fails_for_invalid_tunnel_config(self):
     # An ip address is required for tunneling but there is no default,
     # verify this for both gre and vxlan tunnels.
     cfg.CONF.set_override("tunnel_types", [p_const.TYPE_GRE], group="AGENT")
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
     cfg.CONF.set_override("tunnel_types", [p_const.TYPE_VXLAN], group="AGENT")
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:jameschapma,项目名称:neutron,代码行数:9,代码来源:test_ovs_neutron_agent.py


示例3: setUp

    def setUp(self):
        super(TestOvsNeutronAgent, self).setUp()
        notifier_p = mock.patch(NOTIFIER)
        notifier_cls = notifier_p.start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        # Avoid rpc initialization for unit tests
        cfg.CONF.set_override("rpc_backend", "neutron.openstack.common.rpc.impl_fake")
        kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)

        class MockFixedIntervalLoopingCall(object):
            def __init__(self, f):
                self.f = f

            def start(self, interval=0):
                self.f()

        with contextlib.nested(
            mock.patch(
                "neutron.plugins.openvswitch.agent.ovs_neutron_agent." "OVSNeutronAgent.setup_integration_br",
                return_value=mock.Mock(),
            ),
            mock.patch(
                "neutron.plugins.openvswitch.agent.ovs_neutron_agent." "OVSNeutronAgent.setup_ancillary_bridges",
                return_value=[],
            ),
            mock.patch("neutron.agent.linux.ovs_lib.OVSBridge." "get_local_port_mac", return_value="00:00:00:00:00:01"),
            mock.patch("neutron.agent.linux.utils.get_interface_mac", return_value="00:00:00:00:00:01"),
            mock.patch(
                "neutron.openstack.common.loopingcall." "FixedIntervalLoopingCall", new=MockFixedIntervalLoopingCall
            ),
        ):
            self.agent = ovs_neutron_agent.OVSNeutronAgent(**kwargs)
            self.agent.tun_br = mock.Mock()
        self.agent.sg_agent = mock.Mock()
开发者ID:jameschapma,项目名称:neutron,代码行数:35,代码来源:test_ovs_neutron_agent.py


示例4: create_agent_config_map

def create_agent_config_map(conf):
    agent_config = ovs.create_agent_config_map(conf)
    agent_config['hybrid_mode'] = conf.OPFLEX.hybrid_mode
    agent_config['epg_mapping_dir'] = conf.OPFLEX.epg_mapping_dir
    agent_config['opflex_networks'] = conf.OPFLEX.opflex_networks
    agent_config['internal_floating_ip_pool'] = (
        conf.OPFLEX.internal_floating_ip_pool)
    agent_config['internal_floating_ip6_pool'] = (
        conf.OPFLEX.internal_floating_ip6_pool)
    # DVR not supported
    agent_config['enable_distributed_routing'] = False
    # ARP responder not supported
    agent_config['arp_responder'] = False

    # read external-segment next-hop info
    es_info = {}
    multi_parser = cfg.MultiConfigParser()
    multi_parser.read(conf.config_file)
    for parsed_file in multi_parser.parsed:
        for parsed_item in parsed_file.keys():
            if parsed_item.startswith('opflex_external_segment:'):
                es_name = parsed_item.split(':', 1)[1]
                if es_name:
                    es_info[es_name] = parsed_file[parsed_item].items()
    agent_config['external_segment'] = es_info
    agent_config['dhcp_domain'] = conf.dhcp_domain
    return agent_config
开发者ID:AKamyshnikova,项目名称:python-opflex-agent,代码行数:27,代码来源:gbp_ovs_agent.py


示例5: test_create_agent_config_map_enable_tunneling

 def test_create_agent_config_map_enable_tunneling(self):
     # Verify setting only enable_tunneling will default tunnel_type to GRE
     cfg.CONF.set_override("tunnel_types", None, group="AGENT")
     cfg.CONF.set_override("enable_tunneling", True, group="OVS")
     cfg.CONF.set_override("local_ip", "10.10.10.10", group="OVS")
     cfgmap = ovs_neutron_agent.create_agent_config_map(cfg.CONF)
     self.assertEqual(cfgmap["tunnel_types"], [p_const.TYPE_GRE])
开发者ID:jameschapma,项目名称:neutron,代码行数:7,代码来源:test_ovs_neutron_agent.py


示例6: test_create_agent_config_map_enable_distributed_routing

 def test_create_agent_config_map_enable_distributed_routing(self):
     self.addCleanup(cfg.CONF.reset)
     # Verify setting only enable_tunneling will default tunnel_type to GRE
     cfg.CONF.set_override('enable_distributed_routing', True,
                           group='AGENT')
     cfgmap = ovs_neutron_agent.create_agent_config_map(cfg.CONF)
     self.assertEqual(cfgmap['enable_distributed_routing'], True)
开发者ID:afori,项目名称:neutron,代码行数:7,代码来源:test_ovs_dvr_neutron_agent.py


示例7: main

def main():
    cfg.CONF.register_opts(ip_lib.OPTS)
    config.register_root_helper(cfg.CONF)
    common_config.init(sys.argv[1:])
    common_config.setup_logging()
    q_utils.log_opt_values(LOG)

    try:
        agent_config = ovs_neutron_agent.create_agent_config_map(cfg.CONF)
    except ValueError as e:
        LOG.error(_LE('%s Agent terminated!'), e)
        sys.exit(1)

    is_xen_compute_host = 'rootwrap-xen-dom0' in cfg.CONF.AGENT.root_helper
    if is_xen_compute_host:
        # Force ip_lib to always use the root helper to ensure that ip
        # commands target xen dom0 rather than domU.
        cfg.CONF.set_default('ip_lib_force_root', True)

    agent = L2OVSControllerAgent(**agent_config)

    signal.signal(signal.SIGTERM, agent._handle_sigterm)

    # Start everything.
    LOG.info(_LI("Agent initialized successfully, now running... "))
    agent.daemon_loop()
开发者ID:jingtingkang,项目名称:dragonflow,代码行数:26,代码来源:ovs_dragonflow_neutron_agent.py


示例8: test_create_agent_config_map_multiple_tunnel_types

 def test_create_agent_config_map_multiple_tunnel_types(self):
     cfg.CONF.set_override('local_ip', '10.10.10.10', group='OVS')
     cfg.CONF.set_override('tunnel_types', [p_const.TYPE_GRE,
                           p_const.TYPE_VXLAN], group='AGENT')
     cfgmap = ovs_neutron_agent.create_agent_config_map(cfg.CONF)
     self.assertEqual(cfgmap['tunnel_types'],
                      [p_const.TYPE_GRE, p_const.TYPE_VXLAN])
开发者ID:fyelles,项目名称:neutron,代码行数:7,代码来源:test_ovs_neutron_agent.py


示例9: setUp

    def setUp(self):
        super(TestOvsNeutronAgent, self).setUp()
        self.addCleanup(cfg.CONF.reset)
        self.addCleanup(mock.patch.stopall)
        notifier_p = mock.patch(NOTIFIER)
        notifier_cls = notifier_p.start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        # Avoid rpc initialization for unit tests
        cfg.CONF.set_override('rpc_backend',
                              'neutron.openstack.common.rpc.impl_fake')
        cfg.CONF.set_override('report_interval', 0, 'AGENT')
        kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)

        with contextlib.nested(
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent.setup_integration_br',
                       return_value=mock.Mock()),
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent.setup_ancillary_bridges',
                       return_value=[]),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'get_local_port_mac',
                       return_value='00:00:00:00:00:01'),
            mock.patch('neutron.agent.linux.utils.get_interface_mac',
                       return_value='00:00:00:00:00:01')):
            self.agent = ovs_neutron_agent.OVSNeutronAgent(**kwargs)
            self.agent.tun_br = mock.Mock()
        self.agent.sg_agent = mock.Mock()
开发者ID:fyafighter,项目名称:neutron,代码行数:29,代码来源:test_ovs_neutron_agent.py


示例10: setUp

 def setUp(self):
     super(AncillaryBridgesTest, self).setUp()
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     cfg.CONF.set_default("firewall_driver", "neutron.agent.firewall.NoopFirewallDriver", group="SECURITYGROUP")
     cfg.CONF.set_override("report_interval", 0, "AGENT")
     self.kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:noironetworks,项目名称:neutron2,代码行数:9,代码来源:test_ovs_neutron_agent.py


示例11: create_agent_config_map

def create_agent_config_map(conf):
    agent_config = ovs.create_agent_config_map(conf)
    agent_config['hybrid_mode'] = conf.OPFLEX.hybrid_mode
    agent_config['epg_mapping_dir'] = conf.OPFLEX.epg_mapping_dir
    agent_config['opflex_networks'] = conf.OPFLEX.opflex_networks
    # DVR not supported
    agent_config['enable_distributed_routing'] = False
    # ARP responder not supported
    agent_config['arp_responder'] = False
    return agent_config
开发者ID:Kiran-r,项目名称:python-opflex-agent,代码行数:10,代码来源:gbp_ovs_agent.py


示例12: setUp

 def setUp(self):
     super(AncillaryBridgesTest, self).setUp()
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     cfg.CONF.set_default('firewall_driver',
                          'neutron.agent.firewall.NoopFirewallDriver',
                          group='SECURITYGROUP')
     # Avoid rpc initialization for unit tests
     cfg.CONF.set_override('rpc_backend',
                           'neutron.openstack.common.rpc.impl_fake')
     cfg.CONF.set_override('report_interval', 0, 'AGENT')
     self.kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:fyelles,项目名称:neutron,代码行数:14,代码来源:test_ovs_neutron_agent.py


示例13: setUp

    def setUp(self):
        super(TestOvsNeutronAgent, self).setUp()
        notifier_p = mock.patch(NOTIFIER)
        notifier_cls = notifier_p.start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        cfg.CONF.set_default('firewall_driver',
                             'neutron.agent.firewall.NoopFirewallDriver',
                             group='SECURITYGROUP')
        # Avoid rpc initialization for unit tests
        cfg.CONF.set_override('rpc_backend',
                              'neutron.openstack.common.rpc.impl_fake')
        kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)

        class MockFixedIntervalLoopingCall(object):
            def __init__(self, f):
                self.f = f

            def start(self, interval=0):
                self.f()

        with contextlib.nested(
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent.setup_integration_br',
                       return_value=mock.Mock()),
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent.setup_ancillary_bridges',
                       return_value=[]),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'create'),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'set_secure_mode'),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'get_local_port_mac',
                       return_value='00:00:00:00:00:01'),
            mock.patch('neutron.agent.linux.utils.get_interface_mac',
                       return_value='00:00:00:00:00:01'),
            mock.patch('neutron.agent.linux.ovs_lib.'
                       'get_bridges'),
            mock.patch('neutron.openstack.common.loopingcall.'
                       'FixedIntervalLoopingCall',
                       new=MockFixedIntervalLoopingCall),
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent._check_arp_responder_support',
                       return_value=True)):
            self.agent = ovs_neutron_agent.OVSNeutronAgent(**kwargs)
            self.agent.tun_br = mock.Mock()
        self.agent.sg_agent = mock.Mock()
开发者ID:aignatov,项目名称:neutron,代码行数:48,代码来源:test_ovs_neutron_agent.py


示例14: setUp

    def setUp(self):
        super(TestOvsDvrNeutronAgent, self).setUp()
        notifier_p = mock.patch(NOTIFIER)
        notifier_cls = notifier_p.start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        cfg.CONF.set_default('firewall_driver',
                             'neutron.agent.firewall.NoopFirewallDriver',
                             group='SECURITYGROUP')
        kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)

        class MockFixedIntervalLoopingCall(object):
            def __init__(self, f):
                self.f = f

            def start(self, interval=0):
                self.f()

        with contextlib.nested(
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent.setup_integration_br',
                       return_value=mock.Mock()),
            mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.'
                       'OVSNeutronAgent.setup_ancillary_bridges',
                       return_value=[]),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'create'),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'set_secure_mode'),
            mock.patch('neutron.agent.linux.ovs_lib.OVSBridge.'
                       'get_local_port_mac',
                       return_value='00:00:00:00:00:01'),
            mock.patch('neutron.agent.linux.utils.get_interface_mac',
                       return_value='00:00:00:00:00:01'),
            mock.patch('neutron.agent.linux.ovs_lib.BaseOVS.get_bridges'),
            mock.patch('neutron.openstack.common.loopingcall.'
                       'FixedIntervalLoopingCall',
                       new=MockFixedIntervalLoopingCall)):
            self.agent = ovs_neutron_agent.OVSNeutronAgent(**kwargs)
            # set back to true because initial report state will succeed due
            # to mocked out RPC calls
            self.agent.use_call = True
            self.agent.tun_br = mock.Mock()
        self.agent.sg_agent = mock.Mock()
开发者ID:afori,项目名称:neutron,代码行数:44,代码来源:test_ovs_dvr_neutron_agent.py


示例15: setUp

    def setUp(self):
        super(TestOvsNeutronAgent, self).setUp()
        self.addCleanup(cfg.CONF.reset)
        self.addCleanup(mock.patch.stopall)
        notifier_p = mock.patch(NOTIFIER)
        notifier_cls = notifier_p.start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        # Avoid rpc initialization for unit tests
        cfg.CONF.set_override("rpc_backend", "neutron.openstack.common.rpc.impl_fake")
        cfg.CONF.set_override("report_interval", 0, "AGENT")
        kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF)

        with contextlib.nested(
            mock.patch(
                "neutron.plugins.openvswitch.agent.ovs_neutron_agent." "OVSNeutronAgent.setup_integration_br",
                return_value=mock.Mock(),
            ),
            mock.patch("neutron.agent.linux.utils.get_interface_mac", return_value="00:00:00:00:00:01"),
        ):
            self.agent = ovs_neutron_agent.OVSNeutronAgent(**kwargs)
            self.agent.tun_br = mock.Mock()
        self.agent.sg_agent = mock.Mock()
开发者ID:Brocade-OpenSource,项目名称:OpenStack-DNRM-Neutron,代码行数:23,代码来源:test_ovs_neutron_agent.py


示例16: test_create_agent_config_map_fails_for_invalid_tunnel_type

 def test_create_agent_config_map_fails_for_invalid_tunnel_type(self):
     self.addCleanup(cfg.CONF.reset)
     cfg.CONF.set_override('tunnel_types', ['foobar'], group='AGENT')
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:fyafighter,项目名称:neutron,代码行数:5,代码来源:test_ovs_neutron_agent.py


示例17: test_create_agent_config_map_fails_no_local_ip

 def test_create_agent_config_map_fails_no_local_ip(self):
     self.addCleanup(cfg.CONF.reset)
     # An ip address is required for tunneling but there is no default
     cfg.CONF.set_override('enable_tunneling', True, group='OVS')
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:fyafighter,项目名称:neutron,代码行数:6,代码来源:test_ovs_neutron_agent.py


示例18: test_create_agent_config_map_succeeds

 def test_create_agent_config_map_succeeds(self):
     self.assertTrue(ovs_neutron_agent.create_agent_config_map(cfg.CONF))
开发者ID:fyafighter,项目名称:neutron,代码行数:2,代码来源:test_ovs_neutron_agent.py


示例19: test_create_agent_config_map_fails_no_local_ip

 def test_create_agent_config_map_fails_no_local_ip(self):
     # An ip address is required for tunneling but there is no default
     cfg.CONF.set_override("tunnel_types", [p_const.TYPE_VXLAN], group="AGENT")
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:noironetworks,项目名称:neutron2,代码行数:5,代码来源:test_ovs_neutron_agent.py


示例20: test_create_agent_config_map_fails_for_invalid_tunnel_type

 def test_create_agent_config_map_fails_for_invalid_tunnel_type(self):
     cfg.CONF.set_override("tunnel_types", ["foobar"], group="AGENT")
     with testtools.ExpectedException(ValueError):
         ovs_neutron_agent.create_agent_config_map(cfg.CONF)
开发者ID:jameschapma,项目名称:neutron,代码行数:4,代码来源:test_ovs_neutron_agent.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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