diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py index 97f32a59075f0e32b0eb8ce4d05f507a731a20d8..fe2f99d646d7b86612651e899237c0eacbf1d7ea 100755 --- a/src/mpsd_software_manager/mpsd_software.py +++ b/src/mpsd_software_manager/mpsd_software.py @@ -551,9 +551,7 @@ def run(*args, counter=[0], **kwargs): return process -def record_script_execution_summary( - mpsd_release: str, root_dir: str, msg: str = None, **kwargs -) -> None: +def record_script_execution_summary(root_dir: str, msg: str = None, **kwargs) -> None: """Log the command used to build the package_set. It also logs information about the spack-environments branch and commit hash, @@ -562,8 +560,6 @@ def record_script_execution_summary( Parameters ---------- - - mpsd_release : str - The name of the release to install toolchains for. - root_dir : str The path to the directory where the scripts are located. - msg : str, optional @@ -606,10 +602,11 @@ def record_script_execution_summary( f.write(f"{datetime.datetime.now().isoformat()}, {cmd_line}\n") # logs script version f.write(f"MPSD Software manager version: {__version__}\n") - f.write( - f"Spack environments branch: {spe_branch} " - f"(commit hash: {spe_commit_hash})\n" - ) + if spe_branch and spe_commit_hash: + f.write( + f"Spack environments branch: {spe_branch} " + f"(commit hash: {spe_commit_hash})\n" + ) def clone_repo( @@ -787,7 +784,7 @@ def prepare_environment(mpsd_release: str, root_dir: Path) -> List[str]: mpsd_release, root_dir ) record_script_execution_summary( - mpsd_release, root_dir, spe_branch=spe_branch, spe_commit_hash=spe_commit_hash + root_dir, spe_branch=spe_branch, spe_commit_hash=spe_commit_hash ) return available_package_sets @@ -938,12 +935,10 @@ def install_environment( # log the command record_script_execution_summary( - mpsd_release, root_dir, msg=f"installing {package_set} and logging at {build_log_path}", ) record_script_execution_summary( - mpsd_release, root_dir, msg=( f"CMD: bash {spack_setup_script} {' '.join(install_flags)} "