diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py index 4fcd65f708aa4fe8142938340f108eb0f1b28206..3f6b33feb0e17659c36fd8caa61e6885d37e918d 100755 --- a/mpsd-software-environment.py +++ b/mpsd-software-environment.py @@ -12,7 +12,6 @@ import time from pathlib import Path from typing import List, Tuple, Union import re -from string import Template # If 'rich' is available ("pip install rich" or "apt-get install python3-rich"), # then use coloured output, otherwise proceed as before @@ -38,14 +37,7 @@ call_date_iso = ( config_vars = { # kept inside the mpsd_release folder "cmd_log_file": "script_execution_summary.log", - # Placeholder installer log file name, placed at mpsd_microarch/logs - "installer_log_template": Template( - "${mpsd_release}_${mpsd_microarch}_${date}_APEX_${action}.log" - ), - # Placeholder build log file name, placed at mpsd_microarch/logs - "build_log_template": Template( - "${mpsd_release}_${mpsd_microarch}_${date}_BUILD_${toolchain}_${action}.log" - ), + # Metadata tags "metadata_tag_open": "!<meta>", "metadata_tag_close": "</meta>!", "spack_environments_repo": "https://gitlab.gwdg.de/mpsd-cs/spack-environments.git", @@ -96,20 +88,16 @@ def create_log_file_names( if toolchain: # if toolchain is given, then we build the build_log_file_name if action in ["install", "remove"]: - log_template = config_vars["build_log_template"] + log_file_name = ( + f"{mpsd_release}_{mpsd_microarch}_{date}_BUILD_{toolchain}_{action}.log" + ) else: return None else: # if toolchain is not given, then we build the installer_log_file_name - log_template = config_vars["installer_log_template"] - - return log_template.substitute( - mpsd_release=mpsd_release, - mpsd_microarch=mpsd_microarch, - date=date, - action=action, - toolchain=toolchain, - ) + log_file_name = f"{mpsd_release}_{mpsd_microarch}_{date}_APEX_{action}.log" + + return log_file_name def log_metadata(key: str, value: str) -> None: