diff --git a/ews/coordinator/utils/jobstatus.py b/ews/coordinator/utils/jobstatus.py index 740cd427374062c3e3951342fd3c5e924fb2cfc0..ba01bf962bf68879991a8b78c31b2af43e824c5c 100644 --- a/ews/coordinator/utils/jobstatus.py +++ b/ews/coordinator/utils/jobstatus.py @@ -12,8 +12,8 @@ class Jobstatus: Context manager to determine and change status of a job based on status file in a given directory. - Only possible status values are 'SUCCESS', 'INPROGRESS', 'HELD', 'WARNING' - and 'ERROR'. + Only possible status values are 'SUCCESS', 'INPROGRESS', 'HELD', 'WARNING', + 'SUCCESS_WITH_WARNING', 'SUCCESS_WITH_ERROR' and 'ERROR'. Use jobStatus.reset(status) to change the current status file. diff --git a/ews/coordinator/utils/processor_utils.py b/ews/coordinator/utils/processor_utils.py index a8792abb801834310aa6e9f8c10111a3c4a15596..75a2eff38d884e12f1249b9de84c203a7edcd2f4 100644 --- a/ews/coordinator/utils/processor_utils.py +++ b/ews/coordinator/utils/processor_utils.py @@ -127,6 +127,17 @@ def open_and_check_config(configFile) -> dict: def parse_json_file_with_tokens(file_path: str, tokens: dict = None) -> dict: + """ + parses a json file, replacing any tokens with values from the tokens dict. Tokens are marked as ${token_name} in the + json file. The tokens dict should be a dictionary of key value pairs where the key is the token and the value is the + value to replace the token with. This function can be called with None for the tokens argument, resulting in a simple + json file parse. + + :param file_path: + :param tokens: + :return: + """ + with open(file_path, 'r') as file: file_string: str = file.read() file.seek(0) # reset the index to read again