def ovs_port_updated(self, ovs_port):
        """
        Changes in ovs port status will be monitored by ovsdb monitor thread
        and notified to topology. This method is the entry port to process
        port online/update event

        @param ovs_port:
        @return : None
        """

        if ovs_port is None:
            LOG.error(_LE("ovs_port is None"))
            return
        LOG.info(_LI("Ovs port updated: %s") % str(ovs_port))
        port_id = ovs_port.get_id()
        old_port = self.ovs_ports.get(port_id)
        if old_port is None:
            # ignore new port that misses some parameters
            if not self._check_ovs_port_integrity(ovs_port):
                return
            else:
                action = "added"
        else:
            action = 'updated'

        self.ovs_ports[port_id] = ovs_port
        port_type = ovs_port.get_type()
        if port_type not in self.ovs_port_type:
            LOG.error(str(ovs_port) % _LE("Unknown port online: %s"))
            return

        handler_name = '_' + port_type + '_port_' + action

        try:
            handler = getattr(self, handler_name, None)
            if handler is not None:
                handler(ovs_port)
        except Exception:
            LOG.exception(_LE(
                "Exception occurred when handling port online event"))
dataset/ETHPy150Open openstack/dragonflow/dragonflow/controller/topology.py/Topology.ovs_port_updated/swapped operands of `%`