def vdp_uplink_proc(self):
LOG.info("<STR_LIT>")<EOL>if not self.is_os_run:<EOL><INDENT>if not self.is_openstack_running():<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>return<EOL><DEDENT>else:<EOL><INDENT>self.is_os_run = True<EOL><DEDENT><DEDENT>if not self.restart_uplink_called or self.process_uplink_ongoing:<EOL><INDENT>LOG.info("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>{'<STR_LIT>': self.restart_uplink_called,<EOL>'<STR_LIT>': self.process_uplink_ongoing})<EOL>return<EOL><DEDENT>if self.phy_uplink is not None:<EOL><INDENT>if (self.uplink_det_compl and (<EOL>self.phy_uplink not in self.ovs_vdp_obj_dict)):<EOL><INDENT>LOG.error("<STR_LIT>", self.phy_uplink)<EOL>return<EOL><DEDENT>if self.phy_uplink in self.ovs_vdp_obj_dict:<EOL><INDENT>self.veth_intf = (self.ovs_vdp_obj_dict[self.phy_uplink].<EOL>get_lldp_local_bridge_port())<EOL><DEDENT>else:<EOL><INDENT>if self.veth_intf is None:<EOL><INDENT>LOG.error("<STR_LIT>")<EOL>return<EOL><DEDENT><DEDENT><DEDENT>if self.static_uplink:<EOL><INDENT>ret = self.static_uplink_detect(self.veth_intf)<EOL><DEDENT>else:<EOL><INDENT>ret = uplink_det.detect_uplink(self.veth_intf)<EOL><DEDENT>if ret is '<STR_LIT>':<EOL><INDENT>if self.phy_uplink is None:<EOL><INDENT>LOG.error("<STR_LIT>")<EOL>return<EOL><DEDENT>self.uplink_down_cnt = self.uplink_down_cnt + <NUM_LIT:1><EOL>if not self.static_uplink and (<EOL>self.uplink_down_cnt < constants.UPLINK_DOWN_THRES):<EOL><INDENT>return<EOL><DEDENT>self.process_uplink_ongoing = True<EOL>upl_msg = VdpQueMsg(constants.UPLINK_MSG_TYPE,<EOL>status='<STR_LIT>',<EOL>phy_uplink=self.phy_uplink,<EOL>br_int=self.br_integ, br_ex=self.br_ex,<EOL>root_helper=self.root_helper)<EOL>self.que.enqueue(constants.Q_UPL_PRIO, upl_msg)<EOL>self.phy_uplink = None<EOL>self.veth_intf = None<EOL>self.uplink_det_compl = False<EOL>self.uplink_down_cnt = <NUM_LIT:0><EOL><DEDENT>elif ret is None:<EOL><INDENT>if self.veth_intf is not None:<EOL><INDENT>LOG.error("<STR_LIT>")<EOL>return<EOL><DEDENT>self.save_uplink(fail_reason=constants.uplink_undiscovered_reason)<EOL><DEDENT>elif ret is '<STR_LIT>':<EOL><INDENT>if self.veth_intf is None:<EOL><INDENT>LOG.error("<STR_LIT>")<EOL>return<EOL><DEDENT>self.uplink_down_cnt = <NUM_LIT:0><EOL>bond_det = self.uplink_bond_intf_process()<EOL>if not self.uplink_det_compl and not bond_det:<EOL><INDENT>if self.phy_uplink is None:<EOL><INDENT>LOG.error("<STR_LIT>")<EOL>return<EOL><DEDENT>self.process_uplink_ongoing = True<EOL>upl_msg = VdpQueMsg(constants.UPLINK_MSG_TYPE,<EOL>status='<STR_LIT>',<EOL>phy_uplink=self.phy_uplink,<EOL>br_int=self.br_integ, br_ex=self.br_ex,<EOL>root_helper=self.root_helper)<EOL>self.que.enqueue(constants.Q_UPL_PRIO, upl_msg)<EOL>LOG.info("<STR_LIT>")<EOL><DEDENT>self.check_periodic_bulk_vm_notif_rcvd()<EOL><DEDENT>else:<EOL><INDENT>LOG.info("<STR_LIT>", ret)<EOL>bond_intf = sys_utils.get_bond_intf(ret)<EOL>if bond_intf is not None:<EOL><INDENT>ret = bond_intf<EOL>LOG.info("<STR_LIT>" %<EOL>{'<STR_LIT>': ret, '<STR_LIT>': bond_intf})<EOL><DEDENT>self.save_uplink(uplink=ret, veth_intf=self.veth_intf)<EOL>self.phy_uplink = ret<EOL>self.process_uplink_ongoing = True<EOL>upl_msg = VdpQueMsg(constants.UPLINK_MSG_TYPE,<EOL>status='<STR_LIT>',<EOL>phy_uplink=self.phy_uplink,<EOL>br_int=self.br_integ, br_ex=self.br_ex,<EOL>root_helper=self.root_helper)<EOL>self.que.enqueue(constants.Q_UPL_PRIO, upl_msg)<EOL>LOG.info("<STR_LIT>")<EOL><DEDENT>
Periodic handler to detect the uplink interface to the switch.

        -> restart_uplink_called: should be called by agent initially to set
        the stored uplink and veth from DB
        -> process_uplink_ongoing: Will be set when uplink message is enqueue
        and reset when dequeued and processed completely
        -> uplink_det_compl: Will be set to True when a valid uplink is
        detected and object created. Will be reset when uplink is down
        -> phy_uplink: Is the uplink interface
        -> veth_intf : Signifies the veth interface.