models.py 文件源码

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

项目:paas-tools 作者: imperodesign 项目源码 文件源码
def get_etcd_client():
    if not hasattr(get_etcd_client, "client"):
        # wire up etcd publishing if we can connect
        try:
            get_etcd_client.client = etcd.Client(
                host=settings.ETCD_HOST,
                port=int(settings.ETCD_PORT))
            get_etcd_client.client.get('/deis')
        except etcd.EtcdException:
            logger.log(logging.WARNING, 'Cannot synchronize with etcd cluster')
            get_etcd_client.client = None
    return get_etcd_client.client
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号