'Restore values to Volume object for provided fields.'

def _restore_vol_base_meta(self, metadata, volume_id, fields):

    LOG.debug('Restoring    volume    base    metadata')
    excludes = []
    key = 'encryption_key_id'
    if ((key in fields) and (key in metadata) and (metadata[key] is not None)):
        self._restore_vol_encryption_meta(volume_id, metadata['volume_type_id'])
    key = 'display_name'
    if ((key in fields) and (key in metadata)):
        target_vol = self.db.volume_get(self.context, volume_id)
        name = target_vol.get(key, '')
        if ((not metadata.get(key)) or (name and (not name.startswith('restore_backup_')))):
            excludes.append(key)
            excludes.append('display_description')
    metadata = self._filter(metadata, fields, excludes=excludes)
    self.db.volume_update(self.context, volume_id, metadata)
