def METHOD_NAME(self, ifname, op):
    index = port_util.get_index_from_str(ifname)
    if op == 'SET' and index is None:
        return
    # catch system error and log as warning level instead of
    # error level in case interface was already deleted
    ifindex = None
    try:
        ifindex = if_nametoindex(ifname)
    except OSError as e:
        logger.log_warning("%s" % str(e))
    if op == 'SET' and ifindex is None:
        return
    # Check if ifname already exist or if index/ifindex changed due to
    # syncd restart
    if (ifname in self.cur_interfaces and
            self.cur_interfaces[ifname] == (index, ifindex)):
        return
    _hash = '{}|{}'.format('PORT_INDEX_TABLE', ifname)
    if op == 'SET':
        self.cur_interfaces[ifname] = (index, ifindex)
        self.set_port_index_table_entry(_hash, str(index), str(ifindex))
    elif op == 'DEL':
        del self.cur_interfaces[ifname]
        self.state_db.delete(self.state_db.STATE_DB, _hash)