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) bridge_classes = { 'br_int': df_ovs_bridge.DFOVSAgentBridge, 'br_phys': br_phys.OVSPhysicalBridge, 'br_tun': br_tun.OVSTunnelBridge } try: agent_config = ona.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(bridge_classes, **agent_config) signal.signal(signal.SIGTERM, agent._handle_sigterm) # Start everything. LOG.info(_LI("Agent initialized successfully, now running... ")) agent.daemon_loop()
def main(): # this is from neutron.plugins.ml2.drivers.openvswitch.agent.main common_config.init(sys.argv[1:]) n_utils.log_opt_values(LOG) common_config.setup_logging() # this is from neutron.plugins.ml2.drivers.openvswitch.agent.openflow. # ovs_ofctl.main bridge_classes = { 'br_int': br_int.OVSIntegrationBridge, 'br_phys': br_phys.OVSPhysicalBridge, 'br_tun': br_tun.OVSTunnelBridge, } # this is from neutron.plugins.ml2.drivers.openvswitch.agent. # ovs_neutron_agent try: agent_config = create_agent_config_map(cfg.CONF) except ValueError: LOG.exception(_LE("Agent failed to create agent config map")) raise SystemExit(1) prepare_xen_compute() validate_local_ip(agent_config['local_ip']) try: agent = OVSBagpipeNeutronAgent(bridge_classes, **agent_config) except (RuntimeError, ValueError) as e: LOG.error(_LE("%s Agent terminated!"), e) sys.exit(1) agent.daemon_loop()