mon.py 文件源码

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

项目:python-ceph-cfg 作者: oms4suse 项目源码 文件源码
def _create_check_retry(self, **kwargs):
        """
        Check the mon service is started and responding with time out.

        On heavily overloaded hardware it can takes a while for the mon service
        to start
        """
        # Number of seconds before a time out.
        timeout = 60
        time_start = time.clock()
        time_end = time_start + timeout
        if self._create_check_responding(**kwargs):
            return True
        while time.clock() < time_end:
            log.info("Mon service did not start up, waiting.")
            time.sleep(5)
            log.info("Retrying mon service.")
            if self._create_check_responding(**kwargs):
                return True
        log.error("Timed out starting mon service")
        raise Error("Failed to get mon service status after '%s' seconds." % (timeout))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号