def main(manager='vnfmanager.vnf_manager.VNFMgrWithStateReport'): # placebo func to replace the server/__init__ with project startup. # pool of threads needed to spawn worker threads for RPC. # Default action for project's startup, explictly maintainly a pool # for manager as it cannot inherit the vnfsvc's thread pool. pool = eventlet.GreenPool() pool.waitall() conf_params = read_sys_args(sys.argv) _register_opts(cfg.CONF) common_config.init(sys.argv[1:]) uuid = conf_params['uuid'] config.setup_logging(cfg.CONF) LOG.warn(_("UUID: %s"), uuid) vnfm_conf_dir = conf_params['vnfm_conf_dir'].split("/") vnfm_conf_dir[-2] = uuid vnfm_conf_dir = "/".join(vnfm_conf_dir) vnfm_conf_path = vnfm_conf_dir+uuid+'.yaml' load_vnfm_conf(vnfm_conf_path) server = vnfsvc_service.Service.create( binary='vnf-manager', topic=topics.set_topic_name(uuid, prefix=topics.VNF_MANAGER), report_interval=60, manager=manager) service.launch(server).wait()
def main(manager='vnfmanager.vnf_manager.VNFMgrWithStateReport'): # placebo func to replace the server/__init__ with project startup. # pool of threads needed to spawn worker threads for RPC. # Default action for project's startup, explictly maintainly a pool # for manager as it cannot inherit the vnfsvc's thread pool. pool = eventlet.GreenPool() pool.waitall() conf_params = read_sys_args(sys.argv) _register_opts(cfg.CONF) common_config.init(sys.argv[1:]) uuid = conf_params['uuid'] config.setup_logging(cfg.CONF) LOG.warn(_("UUID: %s"), uuid) vnfm_conf_dir = conf_params['vnfm_conf_dir'].split("/") vnfm_conf_dir[-2] = uuid vnfm_conf_dir = "/".join(vnfm_conf_dir) vnfm_conf_path = vnfm_conf_dir + uuid + '.yaml' load_vnfm_conf(vnfm_conf_path) server = vnfsvc_service.Service.create( binary='vnf-manager', topic=topics.set_topic_name(uuid, prefix=topics.VNF_MANAGER), report_interval=60, manager=manager) service.launch(server).wait()
def __init__(self, host=None): super(VNFMgrWithStateReport, self).__init__(host=cfg.CONF.host) self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) self.agent_state = { 'binary': 'vnf-manager', 'host': host, 'topic': topics.set_topic_name(self.conf.uuid, prefix=topics.VNF_MANAGER), 'configurations': { 'agent_status': 'COMPLETE', 'agent_id': cfg.CONF.uuid }, 'start_flag': True, 'agent_type': AGENT_VNF_MANAGER } report_interval = 60 self.use_call = True if report_interval: self.heartbeat = loopingcall.FixedIntervalLoopingCall( self._report_state) self.heartbeat.start(interval=report_interval)
def __init__(self, host=None): super(VNFMgrWithStateReport, self).__init__(host=cfg.CONF.host) self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) self.agent_state = { 'binary': 'vnf-manager', 'host': host, 'topic': topics.set_topic_name(self.conf.uuid, prefix=topics.VNF_MANAGER), 'configurations': { 'agent_status': 'COMPLETE', 'agent_id': cfg.CONF.uuid }, 'start_flag': True, 'agent_type': AGENT_VNF_MANAGER} report_interval = 60 self.use_call = True if report_interval: self.heartbeat = loopingcall.FixedIntervalLoopingCall( self._report_state) self.heartbeat.start(interval=report_interval)