def main(): """F5 BIG-IQ agent for OpenStack.""" cfg.CONF.register_opts(OPTS) cfg.CONF.register_opts(manager.OPTS) cfg.CONF.register_opts(INTERFACE_OPTS) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() if not cfg.CONF.agent_id: LOG.error("Agent ID is undefined. Quit process.") sys.exit(1) if not cfg.CONF.bigiq_host: LOG.error("BIG-IQ host is undefined. Quit process.") sys.exit(1) mgr = manager.F5BIGIQAgentManager(cfg.CONF) svc = F5BIGIQAgentService(host=mgr.agent_host, topic=constants.TOPIC_LBAASV2_BIGIQ_AGENT, manager=mgr) service_launch = service_launcher.F5ServiceLauncher(cfg.CONF) service_launch.launch_service(svc) service_launch.wait()
def setup_rootwrap(self): agent_config.register_root_helper(cfg.CONF) self.config(group='AGENT', root_helper=os.environ.get('OS_ROOTWRAP_CMD', SUDO_CMD)) self.config( group='AGENT', root_helper_daemon=os.environ.get('OS_ROOTWRAP_DAEMON_CMD'))
def register_config(): cfg.CONF.register_opts(restproxy_opts, "RESTPROXY") cfg.CONF.register_opts(router_opts, "ROUTER") cfg.CONF.register_opts(nova_opts, "NOVA") cfg.CONF.register_opts(agent_opts, "RESTPROXYAGENT") # include for report_interval cfg.CONF.register_opts(agconfig.AGENT_STATE_OPTS, "AGENT") agconfig.register_root_helper(cfg.CONF)
def register_options(conf): config.register_interface_driver_opts_helper(conf) config.register_agent_state_opts_helper(conf) config.register_availability_zone_opts_helper(conf) dhcp_config.register_agent_dhcp_opts(conf) meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf) config.register_interface_opts(conf) config.register_root_helper(conf)
def register_config(): cfg.CONF.register_opts(restproxy_opts, "RESTPROXY") cfg.CONF.register_opts(router_opts, "ROUTER") cfg.CONF.register_opts(nova_opts, "NOVA") cfg.CONF.register_opts(agent_opts, "RESTPROXYAGENT") # include for report_interval cfg.CONF.register_opts(agconfig.AGENT_STATE_OPTS, "AGENT") agconfig.register_root_helper(cfg.CONF)
def _get_config_opts(self): config = cfg.ConfigOpts() config.register_opts(common_config.core_opts) config.register_opts(common_config.core_cli_opts) logging.register_options(config) agent_config.register_process_monitor_opts(config) agent_config.register_root_helper(config) return config
def init_env(): config.register_root_helper(cfg.CONF) # importing ovs_config got OVS registered cfg.CONF.register_opts(gbp_opts, "OPFLEX") common_config.init(sys.argv[1:]) common_config.setup_logging() config.setup_privsep() utils.log_opt_values(LOG)
def _get_config_opts(self): config = cfg.ConfigOpts() config.register_opts(common_config.core_opts) config.register_opts(common_config.core_cli_opts) logging.register_options(config) agent_config.register_process_monitor_opts(config) agent_config.register_root_helper(config) return config
def register_options(conf): config.register_interface_driver_opts_helper(conf) config.register_agent_state_opts_helper(conf) config.register_availability_zone_opts_helper(conf) dhcp_config.register_agent_dhcp_opts(conf) meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, conf) config.register_interface_opts(conf) config.register_root_helper(conf)
def main(): agent_config.register_root_helper(cfg.CONF) cfg.CONF.register_cli_opts(agent_config.ROOT_HELPER_OPTS, 'AGENT') keepalived.register_cli_l3_agent_keepalived_opts() keepalived.register_l3_agent_keepalived_opts() configure(cfg.CONF) MonitorDaemon(cfg.CONF.pid_file, cfg.CONF.router_id, cfg.CONF.user, cfg.CONF.group, cfg.CONF.namespace, cfg.CONF.conf_dir, cfg.CONF.monitor_interface, cfg.CONF.monitor_cidr).start()
def setup_conf(): """Setup the cfg for the clean up utility. Use separate setup_conf for the utility because there are many options from the main config that do not apply during clean-up. """ conf = cfg.CONF agent_config.register_root_helper(conf=conf) command.register_cmd_opts(command.ip_opts, conf) return conf
def setUp(self): super(BaseSudoTestCase, self).setUp() if not base.bool_from_env('OS_SUDO_TESTING'): self.skipTest('Testing with sudo is not enabled') config.register_root_helper(cfg.CONF) self.config(group='AGENT', root_helper=os.environ.get('OS_ROOTWRAP_CMD', SUDO_CMD)) self.config(group='AGENT', root_helper_daemon=os.environ.get( 'OS_ROOTWRAP_DAEMON_CMD')) config.setup_privsep()
def setUp(self): super(TestVyattaVPNService, self).setUp() self.conf = cfg.CONF agent_config.register_root_helper(self.conf) self.ri_kwargs = { 'root_helper': self.conf.AGENT.root_helper, 'agent_conf': self.conf, 'interface_driver': mock.sentinel.interface_driver } self.agent = mock.Mock() self.vyatta_service = vyatta_vpn_service.VyattaVPNService(self.agent) self.l3_agent = self.vyatta_service.l3_agent
def setUp(self, mock_ovsdb_api, mock_get_port_ofport, mock_set_secure_mode, mock_create_ovs_bridge, mock_setup_base_flows, mock_check_ovs_firewall_restart, mock_modify_tcp_and_udp_learning_flows, mock_mod_ovs_flow): super(TestOVSFirewallDriver, self).setUp() config.register_root_helper(cfg.CONF) cfg.CONF.set_override('security_bridge_mapping', "fake_sec_br:fake_if", 'SECURITYGROUP') mock_get_port_ofport.return_value = 5 self.ovs_firewall = ovs_fw.OVSFirewallDriver() self.ovs_firewall.sg_br = mock.Mock() self.mock_br = ovs_lib.DeferredOVSBridge(self.ovs_firewall.sg_br) self.LOG = ovs_fw.LOG
def launch(binary, manager, topic=None): cfg.CONF(project='neutron') config.register_root_helper(cfg.CONF) common_cfg.init(sys.argv[1:]) config.setup_logging() config.setup_privsep() report_period = cfg.CONF.apic_host_agent.apic_agent_report_interval poll_period = cfg.CONF.apic_host_agent.apic_agent_poll_interval server = service.Service.create(binary=binary, manager=manager, topic=topic, report_interval=report_period, periodic_interval=poll_period) svc.launch(cfg.CONF, server).wait()
def setUp(self, mock_ovsdb_api, mock_get_port_ofport, mock_set_secure_mode, mock_create_ovs_bridge, mock_setup_base_flows, mock_check_ovs_firewall_restart, mock_modify_tcp_and_udp_learning_flows, mock_mod_ovs_flow): super(TestOVSFirewallDriver, self).setUp() config.register_root_helper(cfg.CONF) cfg.CONF.set_override('security_bridge_mapping', "fake_sec_br:fake_if", 'SECURITYGROUP') mock_get_port_ofport.return_value = 5 self.ovs_firewall = ovs_fw.OVSFirewallDriver() self.ovs_firewall.sg_br = mock.Mock() self.mock_br = ovs_lib.DeferredOVSBridge(self.ovs_firewall.sg_br) self.LOG = ovs_fw.LOG
def main(): cfg.CONF.register_opts(OPTS) cfg.CONF.register_opts(manager.OPTS) # import interface options just in case the driver uses namespaces cfg.CONF.register_opts(interface.OPTS) cfg.CONF.register_opts(external_process.OPTS) config.register_interface_driver_opts_helper(cfg.CONF) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() mgr = manager.LbaasAgentManager(cfg.CONF) svc = LbaasAgentService(host=cfg.CONF.host, topic=constants.LOADBALANCER_AGENTV2, manager=mgr) service.launch(cfg.CONF, svc).wait()
def main(): # Load the configuration parameters. cfg.CONF.register_opts(OPTS) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() # Set up RPC mgr = taas_ovs_agent.TaasOvsAgentRpcCallback(cfg.CONF) endpoints = [mgr] conn = n_rpc.create_connection() conn.create_consumer(topics.TAAS_AGENT, endpoints, fanout=False) conn.consume_in_threads() svc = TaaSOVSAgentService( host=cfg.CONF.host, topic=topics.TAAS_PLUGIN, manager=mgr ) service.launch(cfg.CONF, svc).wait()
def main(): """F5 LBaaS agent for OpenStack.""" cfg.CONF.register_opts(OPTS) cfg.CONF.register_opts(manager.OPTS) # pzhang(NOTE): may not be used anywhere, needs to check cfg.CONF.register_opts(INTERFACE_OPTS) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) # alias for common_config.setup_logging()... config.setup_logging() mgr = manager.LbaasAgentManager(cfg.CONF) svc = F5AgentService(host=mgr.agent_host, topic=f5constants.TOPIC_LOADBALANCER_AGENT_V2, manager=mgr) service.launch(cfg.CONF, svc).wait()
def main(): """F5 LBaaS agent for OpenStack.""" cfg.CONF.register_opts(OPTS) cfg.CONF.register_opts(manager.OPTS) cfg.CONF.register_opts(interface.OPTS) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) # alias for common_config.setup_logging()... config.setup_logging() mgr = manager.LbaasAgentManager(cfg.CONF) svc = F5AgentService( host=mgr.agent_host, topic=f5constants.TOPIC_LOADBALANCER_AGENT_V2, manager=mgr ) service.launch(cfg.CONF, svc).wait()
def main(): cfg.CONF.register_opts(ip_lib.OPTS) dhcp_config.register_agent_dhcp_opts(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) common_config.setup_logging() config.setup_privsep() q_utils.log_opt_values(LOG) agent_mode = cfg.CONF.OPFLEX.agent_mode if agent_mode == 'dvs': agent = main_dvs() elif agent_mode == 'dvs_no_binding': agent = main_dvs(no_binding=True) else: agent = main_opflex() if not agent: sys.exit(1) LOG.info("Agent initialized successfully, now running... ") agent.daemon_loop()
def main(): cfg.CONF.register_opts(OPTS) cfg.CONF.register_opts(manager.OPTS) # import interface options just in case the driver uses namespaces config.register_interface_opts(cfg.CONF) config.register_external_process_opts(cfg.CONF) config.register_interface_driver_opts_helper(cfg.CONF) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() config.setup_privsep() LOG.warning('neutron-lbaas is now deprecated. See: ' 'https://wiki.openstack.org/wiki/Neutron/LBaaS/Deprecation') mgr = manager.LbaasAgentManager(cfg.CONF) svc = LbaasAgentService(host=cfg.CONF.host, topic=constants.LOADBALANCER_AGENTV2, manager=mgr) service.launch(cfg.CONF, svc).wait()
def main(): cfg.CONF.register_opts(OPTS) cfg.CONF.register_opts(manager.OPTS) # import interface options just in case the driver uses namespaces config.register_interface_opts(cfg.CONF) config.register_external_process_opts(cfg.CONF) config.register_interface_driver_opts_helper(cfg.CONF) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() config.setup_privsep() LOG.warning('neutron-lbaas is now deprecated. See: ' 'https://wiki.openstack.org/wiki/Neutron/LBaaS/Deprecation') mgr = manager.LbaasAgentManager(cfg.CONF) svc = LbaasAgentService( host=cfg.CONF.host, topic=constants.LOADBALANCER_AGENTV2, manager=mgr ) service.launch(cfg.CONF, svc).wait()
def test_agent_root_helper(self): conf = config.setup_conf() config.register_root_helper(conf) conf.set_override('root_helper', 'my_root_helper', 'AGENT') self.assertEqual(config.get_root_helper(conf), 'my_root_helper')
def setup_rootwrap(self): agent_config.register_root_helper(cfg.CONF) self.config(group='AGENT', root_helper=get_rootwrap_cmd()) self.config(group='AGENT', root_helper_daemon=get_rootwrap_daemon_cmd())
def load_config(): db_options.set_defaults(cfg.CONF) # cfg.CONF.register_opts(manager.OPTS) config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) common_config.init(sys.argv[1:])
def test_agent_root_helper_daemon(self): conf = config.setup_conf() config.register_root_helper(conf) rhd = 'my_root_helper_daemon' conf.set_override('root_helper_daemon', rhd, 'AGENT') self.assertEqual(rhd, conf.AGENT.root_helper_daemon)
def register_options(): config.register_agent_state_opts_helper(cfg.CONF) config.register_root_helper(cfg.CONF) cfg.CONF.register_opts(bgp_dragent_config.BGP_DRIVER_OPTS, 'BGP') cfg.CONF.register_opts(bgp_dragent_config.BGP_PROTO_CONFIG_OPTS, 'BGP') config.register_external_process_opts(cfg.CONF)
def test_root_default(self): conf = config.setup_conf() config.register_root_helper(conf) self.assertEqual(config.get_root_helper(conf), 'sudo')
default=2, min=1, help=_('Redundancy level for SR-IOV backed vNIC attachments. ' 'Minimum value is 1.')), cfg.FloatOpt('vnic_vf_capacity', help=_("Float up to 4dp between 0.0000 and 1.0000 indicating " "the minimum guaranteed capacity of the VFs backing " "an SR-IOV vNIC. Must be a multiple of each physical " "port's minimum capacity granularity. If omitted, " "defaults to the minimum capacity granularity for " "each port.")) ] cfg.CONF.register_opts(agent_opts, "AGENT") a_config.register_agent_state_opts_helper(cfg.CONF) a_config.register_root_helper(cfg.CONF) ACONF = cfg.CONF.AGENT VIF_TYPE_PVM_SRIOV = 'pvm_sriov' class SRIOVNeutronAgent(agent_base.BasePVMNeutronAgent): """Provides VLANs for vNICs (shared-mode SR-IOV VFs via VIOS). Designed to be compatible with the ML2 Neutron Plugin. """ @property def agent_id(self): return 'sriov-agent-%s' % cfg.CONF.host
def test_agent_root_helper_daemon(self): conf = config.setup_conf() config.register_root_helper(conf) rhd = 'my_root_helper_daemon' conf.set_override('root_helper_daemon', rhd, 'AGENT') self.assertEqual(rhd, conf.AGENT.root_helper_daemon)
from oslo_config import cfg from oslo_log import log as logging from oslo_utils import timeutils from neutron.conf.agent import common as config from neutron.conf.agent.database import agents_db if os.name == 'nt': from neutron.agent.windows import utils else: from neutron.agent.linux import utils LOG = logging.getLogger(__name__) config.register_root_helper(cfg.CONF) agents_db.register_db_agents_opts() INTERFACE_NAMESPACE = 'neutron.interface_drivers' execute = utils.execute def load_interface_driver(conf): """Load interface driver for agents like DHCP or L3 agent. :param conf: driver configuration object :raises SystemExit of 1 if driver cannot be loaded """
def setup_rootwrap(self): agent_config.register_root_helper(cfg.CONF) self.config(group='AGENT', root_helper=get_rootwrap_cmd()) self.config(group='AGENT', root_helper_daemon=get_rootwrap_daemon_cmd())
def test_root_default(self): conf = config.setup_conf() config.register_root_helper(conf) self.assertEqual(config.get_root_helper(conf), 'sudo')
def test_agent_root_helper(self): conf = config.setup_conf() config.register_root_helper(conf) conf.set_override('root_helper', 'my_root_helper', 'AGENT') self.assertEqual(config.get_root_helper(conf), 'my_root_helper')