except FileNotFoundError: print(f"Config file: {ARGS.config} was not found. Aborting...", file=sys.stderr) sys.exit(1) else: if not ARGS.quiet: print("\nStarting Caladrius Heron Validation\n") print(f"Loading configuration from file: {ARGS.config}") CONFIG: Dict[str, Any] = loader.load_config(ARGS.config) if not os.path.exists(CONFIG["log.file.dir"]): os.makedirs(CONFIG["log.file.dir"]) LOG_FILE: str = CONFIG["log.file.dir"] + "/validation_heron.log" logs.setup(console=(not ARGS.quiet), logfile=LOG_FILE, debug=ARGS.debug) # GRAPH CLIENT graph_client: GremlinClient = \ loader.get_class(CONFIG["graph.client"])(CONFIG["graph.client.config"]) # HERON METRICS CLIENT metrics_client: HeronMetricsClient = \ loader.get_class(CONFIG["heron.metrics.client"])( CONFIG["heron.metrics.client.config"]) # TOPOLOGY PERFORMANCE MODEL cluster = ARGS.cluster environ = ARGS.environ topology = ARGS.topology
"output should be shown")) parser.add_argument("-q", "--quiet", required=False, action="store_true", help=("Optional flag indicating if log output should " "be suppressed.")) return parser if __name__ == "__main__": ARGS: argparse.Namespace = create_parser().parse_args() if not ARGS.quiet: logs.setup(debug=ARGS.debug) if ARGS.populate and not ARGS.duration: MSG: str = ("Populate flag was supplied but duration argument " "(-d/--duration)was not. Please supply a metrics " "gathering window duration in integer seconds.") if ARGS.quiet: print(MSG) else: LOG.error(MSG) sys.exit(2) try: CONFIG: Dict[str, Any] = loader.load_config(ARGS.config)