Updated modules
This commit is contained in:
1 parent
5c00e7b556
commit
d2b52a679e
2 files changed
+6
-5
No files matched your search
+4
-3
@@ -5,7 +5,8 @@ import time
|
||||
from collections.abc import Generator
|
||||
|
||||
from mysql.connector import Error, pooling
|
||||
from mysql.connector.pooling import MySQLConnection, MySQLConnectionPool
|
||||
from mysql.connector.connection import MySQLConnection
|
||||
from mysql.connector.pooling import MySQLConnectionPool
|
||||
from secret_manager import get_secret
|
||||
|
||||
|
||||
@@ -26,8 +27,8 @@ def get_mysql_config():
|
||||
"""Returns a MYSQL config because creating it on module import lead to the environment variable not being available"""
|
||||
db_host = os.getenv("DB_HOST", "localhost")
|
||||
db_database = os.getenv("DB_DATABASE","app")
|
||||
db_username = get_secret(os.getenv("DB_USERNAME",""),"/etc/secrets/db_username")
|
||||
db_password = get_secret(os.getenv("DB_PASSWORD",""),"/etc/secrets/db_password")
|
||||
db_username = get_secret("DB_USERNAME","/etc/secrets/db_username")
|
||||
db_password = get_secret("DB_PASSWORD","/etc/secrets/db_password")
|
||||
return {
|
||||
"host": db_host,
|
||||
"user": db_username,
|
||||
|
||||
Reference in new issue
Block a user