Пример #1
0
def checker():
    config.process_args("SECURITY_CHECKER",
                        default_config_path=cfg.CHECKER_DEFAULT_CONF_PATH,
                        defaults=cfg.DEFAULT,
                        validation_schema=cfg.SCHEMA)
    _checker = security_checker.Checker()
    LOG.debug("Loading config")
    _checker.configure(config.CONF)
    LOG.info("Entering loop")
    _checker.run()
Пример #2
0
def main():
    config.process_args("HEALTH",
                        default_config_path=cfg.DEFAULT_CONF_PATH,
                        defaults=cfg.DEFAULT,
                        validation_schema=cfg.SCHEMA)
    # Init Elastic index in backend

    for src in CONF["sources"]:
        es.ensure_index_exists(CONF["backend"]["elastic"], src["region"])

    # Setup periodic job that does aggregation magic
    run_every_min = CONF["config"]["run_every_minutes"]
    schedule.every(run_every_min).minutes.do(job)

    job()

    while True:
        schedule.run_pending()
        time.sleep(1)
Пример #3
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--host",
                        default="0.0.0.0",
                        help="A host to bind development server. "
                        "(default 0.0.0.0)")
    parser.add_argument("--port",
                        type=int,
                        default=5000,
                        help="A port to bind development server. "
                        "(default 5000)")
    args = config.process_args("CEAGLE",
                               parser=parser,
                               default_config_path=cfg.DEFAULT_CONF_PATH,
                               defaults=cfg.DEFAULT,
                               validation_schema=cfg.SCHEMA)
    app.app.config["DEBUG"] = args.debug
    app.app.run(host=args.host, port=args.port)