Fix some small todos

This commit is contained in:
Moritz 2024-05-13 14:41:12 +02:00
parent 6ab24af806
commit 87202f9072
1 changed files with 2 additions and 6 deletions

View File

@ -119,7 +119,7 @@ def merge_dict(dict1: Dict[Any, Any], dict2: Dict[Any, Any], reverse_list_order:
return merged_dict
def merge_all_group_configs(dir_path: str) -> Dict[str, Dict[str, Any]]:
def merge_all_group_configs(config_path: str) -> Dict[str, Dict[str, Any]]:
"""
Recursively merges 'alaka.yml/alaka-*.yml' files within a specified directory into a single comprehensive configuration dictionary.
Configurations at higher directory levels get inherited and potentially overridden by configurations in lower directory levels.
@ -131,8 +131,7 @@ def merge_all_group_configs(dir_path: str) -> Dict[str, Dict[str, Any]]:
dict: A dictionary representing the merged configurations from all the 'alaka.yml/alaka-*.yml' files found in the directory hierarchy.
The dictionary's keys are the paths of the directories relative to the root directory specified by 'dir_path', indicating the source of the configurations. Each key maps to its respective merged configuration dictionary, which includes all inherited and overridden settings from higher-level directories down to the specified directory.
"""
# TODO: fix type error
dir_path = Path(dir_path).absolute()
dir_path = Path(config_path).absolute()
merged_configs = {}
for root, _, files in os.walk(dir_path):
no_config_found = True
@ -433,7 +432,6 @@ def exchange_secrets(app1: str, instance_config: Dict[str, Any], apps: List[str]
Returns:
None
"""
#TODO: check this function
app1_config = instance_config[app1]
app1_domain = app1_config['app_domain']
for app2 in apps:
@ -500,7 +498,6 @@ def get_secret(domain: str, secret_name: str) -> str:
Returns:
str: The value of the retrieved secret.
"""
# TODO: use "abra secret get <secret_name>"
secret = abra("app", "run", domain, "worker", "cat", f"/var/run/secrets/{secret_name}")
return secret
@ -581,7 +578,6 @@ def uncomment(keys: List[str], path: str, match_all: bool = False) -> None:
path (str): Path to the file where lines will be uncommented.
match_all (bool): Whether to match the keys against the entire line or just the beginning.
"""
#TODO: fix variablennamen vs inline regex (siehe backupbot)
logging.debug(f'Uncomment {keys} in {path}')
with open(path, "r") as file:
lines = file.readlines()