Skip to content

Commit

Permalink
Adds aliases to tenants.
Browse files Browse the repository at this point in the history
  • Loading branch information
atompie committed Sep 23, 2024
1 parent cc4e188 commit 79a0150
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions tracardi/service/utils/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,3 @@ def pre_config_file_loader(file_path):
return None
logger.info(f"Preconfiguration file `{file_path}` loaded with {len(content) if content else 'no'} definitions.")
return content


def load_file_to_dict(file_path: str) -> dict[str, str]:
my_dict = {}

if not os.path.exists(file_path):
return my_dict

# Open the file in read mode
with open(file_path, 'r') as file:
for line in file:
# Strip any leading/trailing whitespace and split only on the first colon
key_value = line.strip().split(':', 1)

if len(key_value) == 2:
key, value = key_value
my_dict[key.strip()] = value.strip()
else:
logger.error(f"Skipping invalid line in tenant-aliases.txt: {line.strip()}")

return my_dict

0 comments on commit 79a0150

Please sign in to comment.