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


Python config.setup_logging函数代码示例

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


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


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