示例#1
0
文件: manage.py 项目: bias/designate
def main():
    CONF.register_cli_opt(category_opt)

    try:
        utils.read_config('designate', sys.argv)
        logging.setup(CONF, 'designate')
    except cfg.ConfigFilesNotFoundError:
        cfgfile = CONF.config_file[-1] if CONF.config_file else None
        if cfgfile and not os.access(cfgfile, os.R_OK):
            st = os.stat(cfgfile)
            print(_("Could not read %s. Re-running with sudo") % cfgfile)
            try:
                os.execvp('sudo', ['sudo', '-u', '#%s' % st.st_uid] + sys.argv)
            except Exception:
                print(_('sudo failed, continuing as if nothing happened'))

        print(_('Please re-run designate-manage as root.'))
        sys.exit(2)

    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    hookpoints.log_hook_setup()

    fn = CONF.category.action_fn

    fn_args = fetch_func_args(fn)
    fn(*fn_args)
示例#2
0
def main():
    CONF.register_cli_opt(category_opt)

    try:
        utils.read_config('designate', sys.argv)
        logging.setup(CONF, 'designate')
    except cfg.ConfigFilesNotFoundError:
        cfgfile = CONF.config_file[-1] if CONF.config_file else None
        if cfgfile and not os.access(cfgfile, os.R_OK):
            st = os.stat(cfgfile)
            print(_("Could not read %s. Re-running with sudo") % cfgfile)
            try:
                os.execvp('sudo', ['sudo', '-u', '#%s' % st.st_uid] + sys.argv)
            except Exception:
                print(_('sudo failed, continuing as if nothing happened'))

        print(_('Please re-run designate-manage as root.'))
        sys.exit(2)

    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    hookpoints.log_hook_setup()

    fn = CONF.category.action_fn

    fn_args = fetch_func_args(fn)
    fn(*fn_args)
示例#3
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    server = mdns_service.Service()
    service.serve(server, workers=CONF['service:mdns'].workers)
    service.wait()
示例#4
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    server = central.Service(threads=CONF['service:central'].threads)
    service.serve(server, workers=CONF['service:central'].workers)
    service.wait()
示例#5
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    server = agent_service.Service(threads=CONF['service:agent'].threads)
    service.serve(server, workers=CONF['service:agent'].workers)
    service.wait()
示例#6
0
文件: api.py 项目: jkhelil/designate
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    server = api_service.Service(threads=CONF['service:api'].threads)
    launcher = service.launch(server, CONF['service:api'].workers)
    launcher.wait()
示例#7
0
文件: api.py 项目: stenstad/designate
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    server = api_service.Service(threads=CONF['service:api'].threads)
    launcher = service.launch(server, CONF['service:api'].workers)
    launcher.wait()
示例#8
0
文件: central.py 项目: bias/designate
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    hookpoints.log_hook_setup()

    server = central.Service(threads=CONF['service:central'].threads)
    service.serve(server, workers=CONF['service:central'].workers)
    service.wait()
示例#9
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup(CONF, 'designate')
    utils.setup_gmr(log_dir=cfg.CONF.log_dir)

    hookpoints.log_hook_setup()

    server = sink_service.Service(threads=CONF['service:sink'].threads)
    service.serve(server, workers=CONF['service:sink'].workers)
    service.wait()