Beispiel #1
0
def register_options():
    cfg.CONF.register_opts(DhcpAgent.OPTS)
    config.register_agent_state_opts_helper(cfg.CONF)
    config.register_root_helper(cfg.CONF)
    cfg.CONF.register_opts(DeviceManager.OPTS)
    cfg.CONF.register_opts(DhcpLeaseRelay.OPTS)
    cfg.CONF.register_opts(dhcp.OPTS)
    cfg.CONF.register_opts(interface.OPTS)
Beispiel #2
0
def register_options():
    cfg.CONF.register_opts(DhcpAgent.OPTS)
    config.register_agent_state_opts_helper(cfg.CONF)
    config.register_root_helper(cfg.CONF)
    cfg.CONF.register_opts(DeviceManager.OPTS)
    cfg.CONF.register_opts(DhcpLeaseRelay.OPTS)
    cfg.CONF.register_opts(dhcp.OPTS)
    cfg.CONF.register_opts(interface.OPTS)
Beispiel #3
0
def main():
    eventlet.monkey_patch()
    conf = cfg.CONF
    conf.register_opts(L3NATAgent.OPTS)
    config.register_agent_state_opts_helper(conf)
    config.register_root_helper(conf)
    conf.register_opts(interface.OPTS)
    conf.register_opts(external_process.OPTS)
    conf()
    config.setup_logging(conf)
    server = quantum_service.Service.create(
        binary='quantum-l3-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval)
    service.launch(server).wait()
Beispiel #4
0
def main():
    eventlet.monkey_patch()
    cfg.CONF.register_opts(DhcpAgent.OPTS)
    config.register_agent_state_opts_helper(cfg.CONF)
    config.register_root_helper(cfg.CONF)
    cfg.CONF.register_opts(DeviceManager.OPTS)
    cfg.CONF.register_opts(DhcpLeaseRelay.OPTS)
    cfg.CONF.register_opts(dhcp.OPTS)
    cfg.CONF.register_opts(interface.OPTS)
    cfg.CONF(project='quantum')
    config.setup_logging(cfg.CONF)
    server = quantum_service.Service.create(
        binary='quantum-dhcp-agent',
        topic=topics.DHCP_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval)
    service.launch(server).wait()
Beispiel #5
0
def main():
    eventlet.monkey_patch()
    conf = cfg.CONF
    conf.register_opts(L3NATAgent.OPTS)
    config.register_agent_state_opts_helper(conf)
    config.register_root_helper(conf)
    conf.register_opts(interface.OPTS)
    conf.register_opts(external_process.OPTS)
    conf(project='quantum')
    config.setup_logging(conf)
    server = quantum_service.Service.create(
        binary='quantum-l3-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager='quantum.agent.l3_agent.L3NATAgentWithStateReport')
    service.launch(server).wait()
Beispiel #6
0
 def test_dhcp_agent_manager(self):
     state_rpc_str = 'quantum.agent.rpc.PluginReportStateAPI'
     lease_relay_str = 'quantum.agent.dhcp_agent.DhcpLeaseRelay'
     with mock.patch.object(DhcpAgentWithStateReport,
                            'sync_state',
                            autospec=True) as mock_sync_state:
         with mock.patch.object(DhcpAgentWithStateReport,
                                'periodic_resync',
                                autospec=True) as mock_periodic_resync:
             with mock.patch(state_rpc_str) as state_rpc:
                 with mock.patch(lease_relay_str) as mock_lease_relay:
                     with mock.patch.object(sys, 'argv') as sys_argv:
                         sys_argv.return_value = [
                             'dhcp', '--config-file',
                             etcdir('quantum.conf.test')]
                         cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS)
                         config.register_agent_state_opts_helper(cfg.CONF)
                         config.register_root_helper(cfg.CONF)
                         cfg.CONF.register_opts(
                             dhcp_agent.DeviceManager.OPTS)
                         cfg.CONF.register_opts(
                             dhcp_agent.DhcpLeaseRelay.OPTS)
                         cfg.CONF.register_opts(dhcp.OPTS)
                         cfg.CONF.register_opts(interface.OPTS)
                         cfg.CONF(project='quantum')
                         agent_mgr = DhcpAgentWithStateReport('testhost')
                         eventlet.greenthread.sleep(1)
                         agent_mgr.after_start()
                         mock_sync_state.assert_called_once_with(agent_mgr)
                         mock_periodic_resync.assert_called_once_with(
                             agent_mgr)
                         state_rpc.assert_has_calls(
                             [mock.call(mock.ANY),
                              mock.call().report_state(mock.ANY, mock.ANY)])
                         mock_lease_relay.assert_has_calls(
                             [mock.call(mock.ANY),
                              mock.call().start()])
Beispiel #7
0
               help=_("Network type for tenant networks "
                      "(local, vlan, or none)")),
    cfg.ListOpt('network_vlan_ranges',
                default=DEFAULT_VLAN_RANGES,
                help=_("List of <physical_network>:<vlan_min>:<vlan_max> "
                       "or <physical_network>")),
]

bridge_opts = [
    cfg.ListOpt('physical_interface_mappings',
                default=DEFAULT_INTERFACE_MAPPINGS,
                help=_("List of <physical_network>:<physical_interface>")),
]

agent_opts = [
    cfg.IntOpt('polling_interval', default=2,
               help=_("The number of seconds the agent will wait between "
                      "polling for local device changes.")),
    #TODO(rkukura): Change default to False before havana rc1
    cfg.BoolOpt('rpc_support_old_agents', default=True,
                help=_("Enable server RPC compatibility with old agents")),
]


cfg.CONF.register_opts(vlan_opts, "VLANS")
cfg.CONF.register_opts(bridge_opts, "LINUX_BRIDGE")
cfg.CONF.register_opts(agent_opts, "AGENT")
cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
Beispiel #8
0
]

eswitch_opts = [
    cfg.ListOpt('physical_interface_mappings',
                default=DEFAULT_INTERFACE_MAPPINGS,
                help=_("List of <physical_network>:<physical_interface>")),
    cfg.StrOpt('vnic_type',
               default=constants.VIF_TYPE_DIRECT,
               help=_("type of VM network interface: direct or hosdev")),
    cfg.StrOpt('daemon_endpoint',
               default='tcp://127.0.0.1:5001',
               help=_('eswitch daemon end point')),
    cfg.IntOpt('request_timeout',
               default=3000,
               help=_("The number of milliseconds the agent will wait for "
                      "response on request to daemon.")),
]

agent_opts = [
    cfg.IntOpt('polling_interval',
               default=2,
               help=_("The number of seconds the agent will wait between "
                      "polling for local device changes.")),
]

cfg.CONF.register_opts(vlan_opts, "MLNX")
cfg.CONF.register_opts(eswitch_opts, "ESWITCH")
cfg.CONF.register_opts(agent_opts, "AGENT")
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)