From 8b829c4f7cb39010fcad4e8fb57de5b4153289bb Mon Sep 17 00:00:00 2001 From: Yarne Coppens Date: Fri, 2 Aug 2024 11:22:08 +0200 Subject: [PATCH] Put secret file path in definitions --- src/config/definitions.py | 3 ++- src/modules/auth_manager.py | 7 +------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/config/definitions.py b/src/config/definitions.py index 8e97a59..b071e56 100644 --- a/src/config/definitions.py +++ b/src/config/definitions.py @@ -1,3 +1,4 @@ import os -ROOT_PATH = project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) \ No newline at end of file +ROOT_PATH = project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) +SECRETS_FILE_PATH = ROOT_PATH + '/secrets/auth.yaml' \ No newline at end of file diff --git a/src/modules/auth_manager.py b/src/modules/auth_manager.py index f54f4b4..1d744b6 100644 --- a/src/modules/auth_manager.py +++ b/src/modules/auth_manager.py @@ -7,16 +7,11 @@ from src.config import definitions username: str = None password: str = None - -auth_secret_file_location = definitions.ROOT_PATH + '/secrets/auth.yaml' - -auth_secret_file_location - def load_username_password_from_secrets(): global username global password - with open(auth_secret_file_location, 'r') as auth_file: + with open(definitions.SECRETS_FILE_PATH, 'r') as auth_file: auth_object = yaml.safe_load(auth_file) username = auth_object['username']