diff --git a/controller.py b/controller.py index 91a5166..f3bd1e0 100755 --- a/controller.py +++ b/controller.py @@ -534,7 +534,7 @@ def controller( goldenrun_data = {} hdf5_file = Path(hdf5path) - if hdf5_file.is_file(): + if hdf5_file.is_file() and not args.overwrite: clogger.info("HDF5 file already exits") # backup_raw_faultlist is currently not used. # Keeping it for possible future features. @@ -564,16 +564,10 @@ def controller( if not args.append: overwrite_faults = True else: - clogger.warning("Backup does not match, running goldenrun!") - goldenrun = True - - print_fault = True - print_config = True - print_goldenrun = True - - if hdf5mode == "a": - print_config = False - print_goldenrun = False + clogger.warning( + "Backup does not match, run with overwrite flag to overwrite!" + ) + return config_qemu if goldenrun: raw_faultlist = copy.deepcopy(faultlist) @@ -811,6 +805,13 @@ def get_argument_parser(): action="store_true", required=False, ) + parser.add_argument( + "--overwrite", + "-o", + help="Overwrite the existing file", + action="store_true", + required=False, + ) return parser