defmain():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()
最核心的,也是跟rpc相关的部分包括两部分,首先是创建rpc服务端。
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')