Put secret file path in definitions
This commit is contained in:
parent
86c3f54d03
commit
8b829c4f7c
2 changed files with 3 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
ROOT_PATH = project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
ROOT_PATH = project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
SECRETS_FILE_PATH = ROOT_PATH + '/secrets/auth.yaml'
|
||||||
|
|
@ -7,16 +7,11 @@ from src.config import definitions
|
||||||
username: str = None
|
username: str = None
|
||||||
password: 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():
|
def load_username_password_from_secrets():
|
||||||
global username
|
global username
|
||||||
global password
|
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)
|
auth_object = yaml.safe_load(auth_file)
|
||||||
|
|
||||||
username = auth_object['username']
|
username = auth_object['username']
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue