def check_zone_status(hacluster):
'''This unit has not been initialised yet so request a zones file or
set an inital sync'''
if hookenv.is_leader():
if designate_bind.get_sync_time():
# This unit is not the leader but a sync target has already been
# set suggests this is a new unit which has been nominated as
# leader early in its lifecycle. The leader responds to sync
# requests and this unit is the leader so not worth sending out a
# sync request.
designate_bind.retrieve_zones()
else:
# This unit is the leader and no other unit has set up a sync
# target then create one since this is a new deployment
designate_bind.setup_sync()
reactive.set_state('zones.initialised')
else:
# If this unit is not the leader as is not yet initialised then request
# a zones file from a peer
designate_bind.request_sync(hacluster)
designate_bind_handlers.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录