def update_port(self, port_id, values):
        # NOTE(dtantsur): this can lead to very strange errors
        if values in 'uuid':
            msg = _("Cannot overwrite UUID for an existing Port.")
            raise exception.InvalidParameterValue(err=msg)

        try:
            with _session_for_write() as session:
                query = model_query(models.Port)
                query = add_port_filter(query, port_id)
                ref = query.one()
                ref.update(values)
                session.flush()
        except NoResultFound:
            raise exception.PortNotFound(port=port_id)
        except db_exc.DBDuplicateEntry:
            raise exception.MACAlreadyExists(mac=values['address'])
        return ref
dataset/ETHPy150Open openstack/ironic/ironic/db/sqlalchemy/api.py/Connection.update_port/swapped operands of `in`