Esempio n. 1
0
def main(args_str=None):
    if not args_str:
        args_str = ' '.join(sys.argv[1:])
    args = parse_args(args_str)

    _disc_service = DiscoveryService(args.zk_server_ip)
    _disc_service.master_election("/svc-monitor", os.getpid(), run_svc_monitor,
                                  args)
    def __init__(self, zk_server_ip):
        while True:
            try:
                self._zk_client = DiscoveryService(zk_server_ip)
                break
            except gevent.event.Timeout as e:
                pass

        self._subnet_allocators = {}