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

Python config.setup_logging函数代码示例

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

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



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

示例1: _configure_agent

    def _configure_agent(self, host):
        conf = self._get_config_opts()
        l3_agent_main.register_opts(conf)
        cfg.CONF.set_override('debug', False)
        agent_config.setup_logging()
        conf.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')
        conf.set_override('router_delete_namespaces', True)
        conf.set_override('root_helper', self.root_helper, group='AGENT')

        br_int = self.create_ovs_bridge()
        br_ex = self.create_ovs_bridge()
        conf.set_override('ovs_integration_bridge', br_int.br_name)
        conf.set_override('external_network_bridge', br_ex.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path,
                                               root=temp_dir)
        conf.set_override('state_path', temp_dir.path)
        conf.set_override('metadata_proxy_socket',
                          get_temp_file_path('metadata_proxy'))
        conf.set_override('ha_confs_path',
                          get_temp_file_path('ha_confs'))
        conf.set_override('external_pids',
                          get_temp_file_path('external/pids'))
        conf.set_override('host', host)
        agent = l3_test_agent.TestL3NATAgent(host, conf)
        mock.patch.object(ip_lib, 'send_gratuitous_arp').start()

        return agent
开发者ID:noironetworks,项目名称:neutron2,代码行数:31,代码来源:test_l3_agent.py


示例2: setUp

    def setUp(self):
        super(DHCPAgentOVSTestFramework, self).setUp()
        config.setup_logging()
        self.conf_fixture = self.useFixture(fixture_config.Config())
        self.conf = self.conf_fixture.conf
        dhcp_agent.register_options(self.conf)

        # NOTE(cbrandily): TempDir fixture creates a folder with 0o700
        # permissions but agent dir must be readable by dnsmasq user (nobody)
        agent_config_dir = self.useFixture(fixtures.TempDir()).path
        self.useFixture(
            helpers.RecursivePermDirFixture(agent_config_dir, 0o555))

        self.conf.set_override("dhcp_confs", agent_config_dir)
        self.conf.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')
        self.conf.set_override('report_interval', 0, 'AGENT')
        br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        self.conf.set_override('ovs_integration_bridge', br_int.br_name)

        self.mock_plugin_api = mock.patch(
            'neutron.agent.dhcp.agent.DhcpPluginApi').start().return_value
        mock.patch('neutron.agent.rpc.PluginReportStateAPI').start()
        self.agent = agent.DhcpAgentWithStateReport('localhost')

        self.ovs_driver = interface.OVSInterfaceDriver(self.conf)
开发者ID:judytong,项目名称:neutron,代码行数:27,代码来源:test_dhcp_agent.py


示例3: _configure_agent

    def _configure_agent(self, host):
        """Override specific config options"""
        config = self._get_config_opts()
        l3_agent_main.register_opts(config)
        cfg.CONF.set_override("debug", True)
        agent_config.setup_logging()
        config.set_override("interface_driver", "neutron.agent.linux.interface.OVSInterfaceDriver")

        br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        br_ex = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        config.set_override("ovs_integration_bridge", br_int.br_name)
        config.set_override("external_network_bridge", br_ex.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path, root=temp_dir)
        config.set_override("state_path", temp_dir.path)
        config.set_override("metadata_proxy_socket", get_temp_file_path("metadata_proxy"))
        config.set_override("ha_confs_path", get_temp_file_path("ha_confs"))
        config.set_override("external_pids", get_temp_file_path("external/pids"))
        config.set_override("host", host)
        ipsec_config_base_dir = "%s/%s" % (temp_dir.path, "ipsec")
        config.set_override("config_base_dir", ipsec_config_base_dir, group="ipsec")

        config(["--config-file", self.vpn_agent_ini])

        # Assign ip address to br-ex port because it is a gateway
        ex_port = ip_lib.IPDevice(br_ex.br_name)
        ex_port.addr.add(str(PUBLIC_NET[1]))

        return vpn_agent.VPNAgent(host, config)
开发者ID:wywangsh,项目名称:neutron-vpnaas,代码行数:30,代码来源:test_scenario.py


示例4: main

def main():
    cfg.CONF.register_opts(common_params.df_opts, 'df')
    common_config.init(sys.argv[1:])
    config.setup_logging()
    service = PublisherService()
    service.initialize()
    service.run()
开发者ID:FrankDuan,项目名称:df_code,代码行数:7,代码来源:df_publisher_service.py


示例5: _configure_agent

    def _configure_agent(self, host):
        conf = self._get_config_opts()
        l3_agent._register_opts(conf)
        cfg.CONF.set_override('debug', False)
        agent_config.setup_logging()
        conf.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')
        conf.set_override('router_delete_namespaces', True)
        conf.set_override('root_helper', self.root_helper, group='AGENT')

        br_int = self.create_ovs_bridge()
        br_ex = self.create_ovs_bridge()
        conf.set_override('ovs_integration_bridge', br_int.br_name)
        conf.set_override('external_network_bridge', br_ex.br_name)

        temp_dir = self.useFixture(fixtures.TempDir()).path
        conf.set_override('state_path', temp_dir)
        conf.set_override('metadata_proxy_socket',
                          '%s/metadata_proxy' % temp_dir)
        conf.set_override('ha_confs_path',
                          '%s/ha_confs' % temp_dir)
        conf.set_override('external_pids',
                          '%s/external/pids' % temp_dir)
        conf.set_override('host', host)
        agent = l3_test_agent.TestL3NATAgent(host, conf)
        mock.patch.object(agent, '_arping').start()

        return agent
开发者ID:hzhou8,项目名称:neutron,代码行数:29,代码来源:test_l3_agent.py


示例6: setUp

 def setUp(self):
     super(TestNetnsWrapper, self).setUp()
     config.setup_logging()
     self.fake_ns = 'func-8f1b728c-6eca-4042-9b6b-6ef66ab9352a'
     self.mount_paths = ('--mount_paths=/etc:/var/lib/neutron'
                         '/vpnaas/%(ns)s/etc,/var/run:/var/lib'
                         '/neutron/vpnaas/%(ns)s/var/run')
     self.fake_pth = self.mount_paths % {'ns': self.fake_ns}
开发者ID:JinJingLin,项目名称:neutron-vpnaas,代码行数:8,代码来源:test_netns_wrapper.py


示例7: _configure

 def _configure(self):
     config.setup_logging()
     config.register_interface_driver_opts_helper(cfg.CONF)
     cfg.CONF.set_override(
         'interface_driver',
         'neutron.agent.linux.interface.OVSInterfaceDriver')
     cfg.CONF.register_opts(interface.OPTS)
     self.driver = importutils.import_object(cfg.CONF.interface_driver,
                                             cfg.CONF)
开发者ID:kodarkI,项目名称:neutron,代码行数:9,代码来源:test_ip_lib.py


示例8: main

def main(manager='neutron.services.tunnel.agent.TunnelAgentWithStateReport'):
    common_config.init(sys.argv[1:])
    config.setup_logging(cfg.CONF)
    server = neutron_service.Service.create(
            binary='neutron-tunnel-agent',
            topic=n_topics.TUNNEL_AGENT,
            report_interval=cfg.CONF.tunnel_agent.report_interval,
            manager=manager)
    service.launch(server).wait()
开发者ID:CingHu,项目名称:neutron-ustack,代码行数:9,代码来源:agent.py


示例9: launch

def launch(binary, manager, topic=None):
    cfg.CONF(project='neutron')
    common_cfg.init(sys.argv[1:])
    config.setup_logging()
    report_period = cfg.CONF.ml2_cisco_apic.apic_agent_report_interval
    poll_period = cfg.CONF.ml2_cisco_apic.apic_agent_poll_interval
    server = service.Service.create(
        binary=binary, manager=manager, topic=topic,
        report_interval=report_period, periodic_interval=poll_period)
    svc.launch(server).wait()
开发者ID:cotsog,项目名称:apic-ml2-driver,代码行数:10,代码来源:apic_topology.py


示例10: main

def main():
    register_options()
    common_config.init(sys.argv[1:])
    config.setup_logging()

    hyperv_agent = l2_agent.HyperVNeutronAgent()

    # Start everything.
    LOG.info(_LI("Agent initialized successfully, now running... "))
    hyperv_agent.daemon_loop()
开发者ID:Akanksha08,项目名称:neutron,代码行数:10,代码来源:hyperv_neutron_agent.py


示例11: main

def main():
    config.register_agent_state_opts_helper(cfg.CONF)
    common_config.init(sys.argv[1:])
    config.setup_logging()

    hyperv_agent = HyperVNeutronAgent()

    # Start everything.
    LOG.info(_LI("Agent initialized successfully, now running... "))
    hyperv_agent.daemon_loop()
开发者ID:alinbalutoiu,项目名称:networking-hyperv,代码行数:10,代码来源:l2_agent.py


示例12: main

def main(manager=FWAAS_AGENT):
    register_opts(cfg.CONF)
    common_config.init(sys.argv[1:])
    config.setup_logging()
    server = neutron_service.Service.create(
        binary='neutron-l3-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager=manager)
    service.launch(cfg.CONF, server).wait()
开发者ID:paperandsoap,项目名称:neutron-fwaas,代码行数:10,代码来源:fw.py


示例13: main

def main(manager='neutron.agent.l3_highperformance_agent.L3NATAgentWithStateReport'):
    _register_opts(cfg.CONF)
    common_config.init(sys.argv[1:])
    config.setup_logging()
    server = neutron_service.Service.create(
        binary='neutron-l3-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager=manager)
    service.launch(server).wait()
开发者ID:HybridCloud-dew,项目名称:hws,代码行数:10,代码来源:l3_highperformance_agent.py


示例14: main

def main():
    register_options()
    common_config.init(sys.argv[1:])
    config.setup_logging(cfg.CONF)
    server = neutron_service.Service.create(
        binary='neutron-dhcp-agent',
        topic=topics.DHCP_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager='neutron.agent.dhcp_agent.DhcpAgentWithStateReport')
    service.launch(server).wait()
开发者ID:CingHu,项目名称:neutron-ustack,代码行数:10,代码来源:dhcp_agent.py


示例15: main

def main():
    register_options()
    common_config.init(sys.argv[1:])
    config.setup_logging()
    server = neutron_service.Service.create(
        binary='neutron-bgp-dragent',
        topic=bgp_consts.BGP_DRAGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager='neutron_dynamic_routing.services.bgp.agent.bgp_dragent.'
                'BgpDrAgentWithStateReport')
    service.launch(cfg.CONF, server).wait()
开发者ID:ruansteve,项目名称:neutron-dynamic-routing,代码行数:11,代码来源:entry.py


示例16: main

def main():
    eventlet.monkey_patch()
    register_options()
    cfg.CONF(project='neutron')
    config.setup_logging(cfg.CONF)
    server = neutron_service.Service.create(
        binary='neutron-dhcp-agent',
        topic=topics.DHCP_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager='neutron.agent.dhcp_agent.DhcpAgentWithStateReport')
    service.launch(server).wait()
开发者ID:actus10,项目名称:neutron,代码行数:11,代码来源:dhcp_agent.py


示例17: main

def main(manager='neutron.agent.l3_data_engine.L3DataEngineWithStateReport'):
    _register_opts(cfg.CONF)
    common_config.init(sys.argv[1:])
    config.setup_logging()
    server = neutron_service.Service.create(
        binary='neutron-l3-data-engine',
        topic='%s-%s' % (topics.L3_DATAENGINE,
                         cfg.CONF.agent_index),
        report_interval=cfg.CONF.AGENT.report_interval,
        manager=manager)
    service.launch(server).wait()
开发者ID:HybridCloud-dew,项目名称:hws,代码行数:11,代码来源:l3_data_engine.py


示例18: main

def main(manager="neutron.services.skycloud.portforward_agent.PortForwardAgent"):
    eventlet.monkey_patch()
    conf = cfg.CONF
    conf(project='neutron')
    config.setup_logging(conf)
    legacy.modernize_quantum_config(conf)
    server = neutron_service.Service.create(
        binary='neutron-portforward-agent',
        topic=skycloud_constants.PORT_FORWARD_AGENT_TOPIC,
        report_interval=60, host=conf.host,
        manager=manager)
    service.launch(server).wait()
开发者ID:swordboy,项目名称:neutron-portforward-service,代码行数:12,代码来源:portforward_agent.py


示例19: main

def main(manager='dragonflow.neutron.agent.l3.l3_controller_agent.'
         'L3ControllerAgentWithStateReport'):
    l3_agent.register_opts(cfg.CONF)
    common_config.init(sys.argv[1:])
    config.setup_logging()
    cfg.CONF.set_override('router_delete_namespaces', True)
    server = neutron_service.Service.create(
        binary='neutron-l3-controller-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager=manager)
    service.launch(cfg.CONF, server).wait()
开发者ID:xujinrong,项目名称:dragonflow,代码行数:12,代码来源:l3_sdn_agent.py


示例20: main

def main():
    conf = cfg.CONF
    conf.register_opts(QosAgent.Opts)
    config.register_agent_state_opts_helper(conf)
    config.register_root_helper(conf)
    common_config.init(sys.argv[1:])
    config.setup_logging()
    server = neutron_service.Service.create(
        binary='neutron-qos-agent',
        topic=qos_rpc_agent_api.QOS_AGENT,
        manager='neutron.services.qos.agents.'
                'qos_agent.QosAgentWithStateReport')
    service.launch(server).wait()
开发者ID:chenyanfun,项目名称:neutron-qos,代码行数:13,代码来源:qos_agent.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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