Commit aa266c78 authored by Enrique Garcia's avatar Enrique Garcia
Browse files

Merge branch 'propagate_var_call' into 'master'

Propagate var call

See merge request !11
parents bd887296 09e2dd57
Pipeline #118197 passed with stage
in 1 minute and 39 seconds
...@@ -140,6 +140,31 @@ def compute_nb_total_thread(conf): ...@@ -140,6 +140,31 @@ def compute_nb_total_thread(conf):
return total_nb_threads return total_nb_threads
def propagate_var_call_yml_config(config_file):
Propagate the 'common vars' into the nested key/values of the dict of dicts.
:param config_file: dict
loaded conf dictionary.
config_file: dict
# TODO var replacement in config. Only vars that are passed to hiperta_stream_r0_dl1.
# The rest is HiPeRTA who manages it
if config_file['common_abs_path'] is None:
print(f'Key entry `common_abs_path` needs to be defined !')
config_file['exchange_dir']['exchange_dl1'] = \
config_file['exchange_dir']['exchange_dl1'].replace('${common_abs_path}', config_file['common_abs_path'])
config_file['exchange_dir']['exchange_dl2'] = \
config_file['exchange_dir']['exchange_dl2'].replace('${common_abs_path}', config_file['common_abs_path'])
config_file['exchange_dir']['exchange_dl3'] = \
config_file['exchange_dir']['exchange_dl3'].replace('${common_abs_path}', config_file['common_abs_path'])
return config_file
def main(): def main():
timestamp = time.strftime("%Y-%m-%d_%H-%M-%S") timestamp = time.strftime("%Y-%m-%d_%H-%M-%S")
...@@ -171,7 +196,9 @@ def main(): ...@@ -171,7 +196,9 @@ def main():
# TODO function to verify compulsory existing config files and coherent arguments # TODO function to verify compulsory existing config files and coherent arguments
# Read config file # Read config file
configuration = read_config(args.config_file) raw_configuration = read_config(args.config_file)
configuration = propagate_var_call_yml_config(raw_configuration)
host_configuration = configuration['host_config'] host_configuration = configuration['host_config']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment