diff --git a/run_on_maap.py b/run_on_maap.py index 6df7330b1d7875cc889cdf0f3865b9e4caebd38c..2bbb389e5ca8ee5555850858d228e96af588528c 100644 --- a/run_on_maap.py +++ b/run_on_maap.py @@ -31,6 +31,7 @@ Usage: import datetime import logging import os +import shutil from pathlib import Path from typing import Dict, List @@ -186,18 +187,14 @@ def main( if redo_of: validate_redo_tag(run_config) - # Read and log full model configuration + # Copy config file into output directory for safekeeping model_config_path = s3_url_to_local_path(run_config.model_config) try: - with open(model_config_path, "r") as config_file: - full_model_config = config_file.read() + shutil.copy(model_config_path, output_dir / Path(model_config_path).name) except Exception as e: - logging.error("Error reading config file" - f"from {model_config_path}: {str(e)}") + logging.error(f"Error copying config file from {model_config_path}: {str(e)}") raise - logging.debug(f"Configuration:\n{full_model_config}") - # Query the CMR for granules product_granules: Dict[str, List[Granule]] = {} for product in ["l1b", "l2a", "l4a"]: