Skip to content

Commit

Permalink
Pass DATASOURCE_DBNAME from Configuration() to MongoDBConnection() (#294
Browse files Browse the repository at this point in the history
)
  • Loading branch information
oh2fih authored Jun 30, 2024
1 parent 0d1763d commit 1ccd661
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CveXplore/database/connection/database_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ def __init__(self, database_type: str, database_init_parameters: dict):
self.database_type = database_type
self.database_init_parameters = database_init_parameters

self._database_connnections = {
self._database_connections = {
"mongodb": MongoDBConnection,
"api": ApiDatabaseSource,
"mysql": SQLBaseConnection,
"dummy": DummyConnection,
}

self._database_connection = self._database_connnections[self.database_type](
self._database_connection = self._database_connections[self.database_type](
**self.database_init_parameters
)

Expand Down
3 changes: 2 additions & 1 deletion CveXplore/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def __init__(self, **kwargs):
if self.config.DATASOURCE_USER is None
and self.config.DATASOURCE_PASSWORD is None
else f"{self.config.DATASOURCE_PROTOCOL}://{self.config.DATASOURCE_USER}:{self.config.DATASOURCE_PASSWORD}@{self.config.DATASOURCE_HOST}:{self.config.DATASOURCE_PORT}"
)
),
"database": self.config.DATASOURCE_DBNAME,
}
elif self.datasource_type == "mysql":
self._datasource_connection_details = {
Expand Down

0 comments on commit 1ccd661

Please sign in to comment.