__init__.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:borgcube 作者: enkore 项目源码 文件源码
def _process_client_archive_info(self, archive_info):
        if not archive_info.name.startswith(self.job.archive_name):
            log.error('Client tried to push invalid archive %r (id=%s) to repository. Aborting.', archive_info.name, bin_to_hex(archive_info.id))
            raise ValueError('BorgCube: illegal archive push %r' % archive_info.name)

        log.debug('Adding archive %r (id %s)', archive_info.name, bin_to_hex(archive_info.id))

        checkpoint_re = re.escape(self.job.archive_name) + r'\.checkpoint(\d+)?'
        if re.fullmatch(checkpoint_re, archive_info.name):
            log.debug('%r is a checkpoint - remembering that', archive_info.name)
            self._add_checkpoint(archive_info.id)
        else:
            log.debug('%r is the finalised archive', archive_info.name)
            self._final_archive = True

        if not self._cache_sync_archive(archive_info.id):
            log.error('Failed to synchronize archive %r into cache (see above), aborting.', archive_info.name)
            raise ValueError('BorgCube: cache sync failed')

        # TODO additional sanitation?
        self._manifest.archives[archive_info.name] = archive_info.id, archive_info.ts
        log.info('Added archive %r (id %s) to repository.', archive_info.name, bin_to_hex(archive_info.id))
        self._got_archive = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号