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 collections.abc import Generator
|
||||||
|
|
||||||
from mysql.connector import Error, pooling
|
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
|
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"""
|
"""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_host = os.getenv("DB_HOST", "localhost")
|
||||||
db_database = os.getenv("DB_DATABASE","app")
|
db_database = os.getenv("DB_DATABASE","app")
|
||||||
db_username = get_secret(os.getenv("DB_USERNAME",""),"/etc/secrets/db_username")
|
db_username = get_secret("DB_USERNAME","/etc/secrets/db_username")
|
||||||
db_password = get_secret(os.getenv("DB_PASSWORD",""),"/etc/secrets/db_password")
|
db_password = get_secret("DB_PASSWORD","/etc/secrets/db_password")
|
||||||
return {
|
return {
|
||||||
"host": db_host,
|
"host": db_host,
|
||||||
"user": db_username,
|
"user": db_username,
|
||||||
|
|||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "lib-db-module"
|
name = "lib-db-module"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
description = "Shared database module"
|
description = "Shared database module"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
authors = [{ name = "Florian Gänsejunge" }]
|
authors = [{ name = "Florian Gänsejunge" }]
|
||||||
dependencies = ["mysql-connector-python==9.4.0","lib-secret-manager"]
|
dependencies = ["mysql-connector-python==26.10.0","lib-secret-manager"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=61", "wheel"]
|
requires = ["setuptools>=61", "wheel"]
|
||||||
|
|||||||
Reference in new issue
Block a user