From f154bcb69239671e813d507649b0f88c4617a1b8 Mon Sep 17 00:00:00 2001 From: Paige Rubendall Date: Thu, 25 Jan 2024 09:15:41 -0500 Subject: [PATCH] adding krkn report location Signed-off-by: Paige Rubendall --- run_kraken.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/run_kraken.py b/run_kraken.py index 5c1e5ae1..0bae4067 100644 --- a/run_kraken.py +++ b/run_kraken.py @@ -34,7 +34,7 @@ from krkn_lib.utils.functions import get_yaml_item_value - +report_file = "" # Main function def main(cfg): @@ -414,10 +414,9 @@ def main(cfg): ) sys.exit(1) - run_dir = os.getcwd() + "/kraken.report" logging.info( "Successfully finished running Kraken. UUID for the run: " - "%s. Report generated at %s. Exiting" % (run_uuid, run_dir) + "%s. Report generated at %s. Exiting" % (run_uuid, report_file) ) else: logging.error("Cannot find a config at %s, please check" % (cfg)) @@ -434,12 +433,21 @@ def main(cfg): help="config location", default="config/config.yaml", ) + parser.add_option( + "-o", + "--output", + dest="output", + help="output report location", + default="kraken.report", + ) + (options, args) = parser.parse_args() + report_file = options.output logging.basicConfig( level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s", handlers=[ - logging.FileHandler("kraken.report", mode="w"), + logging.FileHandler(report_file, mode="w"), logging.StreamHandler(), ], )