本文整理汇总了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
示例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)
示例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)
示例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()
示例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
示例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}
示例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)
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()