client.py 文件源码

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

项目:tornetcd 作者: mqingyn 项目源码 文件源码
def _check_cluster_id(self, response):
        cluster_id = response.headers.get("x-etcd-cluster-id")
        if not cluster_id:
            _log.warning("etcd response did not contain a cluster ID")
            return
        id_changed = (self.expected_cluster_id and
                      cluster_id != self.expected_cluster_id)
        # Update the ID so we only raise the exception once.
        old_expected_cluster_id = self.expected_cluster_id
        self.expected_cluster_id = cluster_id
        if id_changed:
            # Defensive: clear the pool so that we connect afresh next
            # time.
            self._base_url = self._choice_machine()
            _log.error(
                    'The UUID of the cluster changed from {} to '
                    '{}.'.format(old_expected_cluster_id, cluster_id))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号