gobgp_config_worker.py 文件源码

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

项目:sdwan_orchestrator_with_gobgp 作者: ttsubo 项目源码 文件源码
def _consume_loop(self):
        new_configs = {}
        while True:
            eventlet.sleep(5)
            client = etcd.Client(self.host, self.port)
            try:
                new_configs = self._readConfig(client)
                target_configs_list = self._detect_target_configs(new_configs)
                for target_config in target_configs_list:
                    uuid = target_config['id']
                    body = target_config['body']
                    version = body['version']
                    result = self.func(body)
                    if result == True:
                        self._writeState(client, uuid, version, self.resource, "ACTIVE")
                    elif result == False:
                        self._writeState(client, uuid, version, self.resource, "FAILED")
            except etcd.EtcdKeyNotFound:
                continue
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号