zfs.py 文件源码

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

项目:znappy 作者: eBayClassifiedsGroup 项目源码 文件源码
def check_snapshot_sync(self, znappy, *args, **kwargs):
        local_snapshots = self.zfs_snapshot_list(self, self.filesystem)

        local_snapshots = set(x.split('@', 2)[1] for x in local_snapshots)
        consul_snapshots = set(znappy.host.snapshots.keys())

        logger.debug(local_snapshots)
        logger.debug(consul_snapshots)

        diff = local_snapshots ^ consul_snapshots

        if len(diff) == 0:
            return True, (0, "OK: No differences in consul and local system")
        elif len(diff) == 1:
            return False, (1, "WARN: {} difference between consul and local system: {}".format(len(diff), ', '.join(diff)))
        else:
            return False, (2, "CRITICAL: {} differences between consul and local system: {}".format(len(diff), ', '.join(diff)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号