Move config parser into daemon_lib

And reformat/add config values for API.
This commit is contained in:
2023-11-29 23:35:12 -05:00
parent 4df5fdbca6
commit 03a738f878
11 changed files with 109 additions and 902 deletions

View File

@ -131,11 +131,11 @@ class MetadataAPIInstance(object):
# Helper functions
def open_database(self):
conn = psycopg2.connect(
host=self.config["metadata_postgresql_host"],
port=self.config["metadata_postgresql_port"],
dbname=self.config["metadata_postgresql_dbname"],
user=self.config["metadata_postgresql_user"],
password=self.config["metadata_postgresql_password"],
host=self.config["api_postgresql_host"],
port=self.config["api_postgresql_port"],
dbname=self.config["api_postgresql_dbname"],
user=self.config["api_postgresql_user"],
password=self.config["api_postgresql_password"],
)
cur = conn.cursor(cursor_factory=RealDictCursor)
return conn, cur