def remove(self, network_id, dpid, port_no): try: self.remove_raw(network_id, dpid, port_no) except KeyError: raise NetworkNotFound(network_id=network_id) except ValueError: raise PortNotFound(network_id=network_id, dpid=dpid, port=port_no)
def remove(self, network_id, dpid, port_no): self.logger.info('processing: %s()', sys._getframe(0).f_code.co_name) try: self.remove_raw(network_id, dpid, port_no) except KeyError: raise NetworkNotFound(network_id=network_id) except ValueError: raise PortNotFound(network_id=network_id, dpid=dpid, port=port_no)
def _set_mac(self, network_id, dpid, port_no, port, mac_address): self.logger.info('processing: %s()', sys._getframe(0).f_code.co_name) if not (port.network_id is None or port.network_id == network_id or port.network_id == self.nw_id_unknown): raise PortNotFound(network_id=network_id, dpid=dpid, port=port_no) port.network_id = network_id port.mac_address = mac_address if port.network_id and port.mac_address: self.send_event( EventMacAddress(dpid, port_no, port.network_id, port.mac_address, True))
def remove_port(self, dpid, port_no): self.logger.info('processing: %s()', sys._getframe(0).f_code.co_name) try: # self.dpids[dpid][port_no] can be already deleted by # port_deleted() port = self[dpid].pop(port_no, None) if port and port.network_id and port.mac_address: self.send_event( EventMacAddress(dpid, port_no, port.network_id, port.mac_address, False)) except KeyError: raise PortNotFound(dpid=dpid, port=port_no, network_id=None)
def _set_mac(self, network_id, dpid, port_no, port, mac_address): if not (port.network_id is None or port.network_id == network_id or port.network_id == self.nw_id_unknown): raise PortNotFound(network_id=network_id, dpid=dpid, port=port_no) port.network_id = network_id port.mac_address = mac_address if port.network_id and port.mac_address: self.send_event(EventMacAddress( dpid, port_no, port.network_id, port.mac_address, True))
def remove_port(self, dpid, port_no): try: # self.dpids[dpid][port_no] can be already deleted by # port_deleted() port = self[dpid].pop(port_no, None) if port and port.network_id and port.mac_address: self.send_event(EventMacAddress(dpid, port_no, port.network_id, port.mac_address, False)) except KeyError: raise PortNotFound(dpid=dpid, port=port_no, network_id=None)
def get_port(self, dpid, port_no): self.logger.info('processing: %s()', sys._getframe(0).f_code.co_name) try: return self[dpid][port_no] except KeyError: raise PortNotFound(dpid=dpid, port=port_no, network_id=None)
def get_port(self, dpid, port_no): try: return self[dpid][port_no] except KeyError: raise PortNotFound(dpid=dpid, port=port_no, network_id=None)