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
gobgp_config_worker.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录