def start(self): # Spawn the thread # Pass the Que as last argument so that in case of exception, the # daemon can exit gracefully. fixme(padkrish) thr_q = utils.EventProcessingThread("VDP_Mgr", self, 'process_queue') thr_q.start() task_err_proc = utils.PeriodicTask(constants.ERR_PROC_INTERVAL, self.process_err_queue) task_err_proc.run() task_uplink = utils.PeriodicTask(constants.UPLINK_DET_INTERVAL, self.vdp_uplink_proc_top) task_uplink.run()
def __init__(self, port_name, phy_uplink, root_helper, is_ncb=True, is_nb=False): """Initialize Routine. param port_name: Port where LLDP/EVB needs to be cfgd param phy_uplink: Physical Interface param root_helper: utility to use when running shell cmds. param is_ncb: Should LLDP be cfgd on Nearest Customer Bridge param is_nb: Should LLDP be cfgd on Nearest Bridge """ # Re-enable this once support becomes available in lldpad. # fixme(padkrish) # cfg.CONF.register_opts(OPTS) self.port_name = port_name self.phy_uplink = phy_uplink self.is_ncb = is_ncb self.is_nb = is_nb self.root_helper = root_helper self.mutex_lock = sys_utils.lock() self.read_vdp_cfg() self.vdp_vif_map = {} self.oui_vif_map = {} self.enable_lldp() sync_timeout_val = int(self.vdp_opts['vdp_sync_timeout']) vdp_periodic_task = sys_utils.PeriodicTask(sync_timeout_val, self._vdp_refrsh_hndlr) self.vdp_periodic_task = vdp_periodic_task vdp_periodic_task.run()
def __init__(self, uplink, integ_br, ext_br, root_helper, vdp_vlan_cb, vdp_mode=constants.VDP_SEGMENT_MODE): # self.root_helper = 'sudo' self.root_helper = root_helper self.uplink = uplink self.integ_br = integ_br self.ext_br = ext_br self.vdp_mode = vdp_mode self.local_vlan_map = {} self.lldpad_info = {} self.lldp_local_veth_port = None self.lldp_ovs_veth_port = None self.ovs_vdp_lock = sys_utils.lock() self.phy_peer_port_num = cconstants.INVALID_OFPORT self.int_peer_port_num = cconstants.INVALID_OFPORT self.int_peer_port = None self.phy_peer_port = None self.ext_br_obj = None self.integ_br_obj = None self.vdp_vlan_cb = vdp_vlan_cb self.uplink_fail_reason = "" self.setup_lldpad = self.setup_lldpad_ports() if not self.setup_lldpad: return flow_check_periodic_task = sys_utils.PeriodicTask( cconstants.FLOW_CHECK_INTERVAL, self._flow_check_handler) self.flow_check_periodic_task = flow_check_periodic_task flow_check_periodic_task.run()
def __init__(self, cb, root_helper, intf_list=None, all_intf=True): """Initialization routine, to configure interface. Also create the periodic task. cb => Callback in case any of the interface TLV changes. intf_list => List of interfaces to be LLDP enabled and monitored. all_intf => Boolean that signifies if all physical interfaces are to be monitored. intf_list will be None, if this variable is True. """ self.pub_lldp = pub_lldp.LldpApi(root_helper) self._init_cfg_interfaces(cb, intf_list, all_intf) per_task = utils.PeriodicTask(constants.PERIODIC_TASK_INTERVAL, self.periodic_discovery_task) per_task.run()