'Restore volume metadata from backup.
If this backup has associated metadata, save it to the restore target
otherwise do nothing.'

def _restore_metadata(self, backup, volume_id):

    try:
        with rbd_driver.RADOSClient(self) as client:
            meta_bak = VolumeMetadataBackup(client, backup.id)
            meta = meta_bak.get()
            if (meta is not None):
                self.put_metadata(volume_id, meta)
            else:
                LOG.debug('Volume    %s    has    no    backed    up    metadata.', backup.volume_id)
    except exception.BackupMetadataUnsupportedVersion:
        msg = _('Metadata    restore    failed    due    to    incompatible    version')
        LOG.error(msg)
        raise exception.BackupOperationError(msg)
