def record_ownership(self, dataset_id, blockdevice_id):
        """
        Record that blockdevice_id is the relevant one for given dataset_id.

        Once a record is made no other entry can overwrite the existing
        one; the relationship is hardcoded and permanent. XXX this may
        interact badly with deletion of dataset where dataset_id is
        auto-generated from name, e.g. flocker-deploy or Docker
        plugin. That is pre-existing issue, though.

        :param UUID dataset_id: The dataset being associated with a
            blockdevice.
        :param unicode blockdevice_id: The blockdevice to associate with the
            dataset.

        :return BlockDeviceOwnership: The updated ownership mapping.
        :raises DatasetAlreadyOwned: if the dataset already has an associated
            blockdevice.
        """
        current_blockdevice_id = self.get(dataset_id)
        if (None, blockdevice_id) not in current_blockdevice_id:
            raise DatasetAlreadyOwned()
        return self.set(dataset_id, blockdevice_id)
dataset/ETHPy150Open ClusterHQ/flocker/flocker/control/_model.py/BlockDeviceOwnership.record_ownership/swapped operands of `not in`