Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass DATASOURCE_DBNAME from Configuration() to MongoDBConnection() #294

Merged
merged 2 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading