'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. 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.'

def record_ownership(self, dataset_id, blockdevice_id):

    current_blockdevice_id = self.get(dataset_id)
    if (current_blockdevice_id not in (None, blockdevice_id)):
        raise DatasetAlreadyOwned()
    return self.set(dataset_id, blockdevice_id)
