'Write the backup\'s metadata to the backup repository.'

def _finalize_backup(self, backup, container, object_meta, object_sha256):

    object_list = object_meta['list']
    object_id = object_meta['id']
    volume_meta = object_meta['volume_meta']
    sha256_list = object_sha256['sha256s']
    extra_metadata = object_meta.get('extra_metadata')
    self._write_sha256file(backup, backup.volume_id, container, sha256_list)
    self._write_metadata(backup, backup.volume_id, container, object_list, volume_meta, extra_metadata)
    backup.object_count = object_id
    backup.save()
    LOG.debug('backup    %s    finished.', backup['id'])
