Skip to content

Commit 9d9d856

Browse files
timopollmeiergreenbonebot
authored andcommitted
Fix database worker args and context start
1 parent 0d90206 commit 9d9d856

File tree

2 files changed

+7
-1
lines changed
  • greenbone/scap

2 files changed

+7
-1
lines changed

greenbone/scap/cpe_match/worker/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CpeMatchDatabaseWriteWorker(ScapDatabaseWriteWorker[CPEMatchString]):
1919
_item_type_plural = CPE_MATCH_TYPE_PLURAL
2020
"Plural form of the type of items to use in log messages."
2121

22-
_arg_defaults = ScapDatabaseWriteWorker.arg_defaults
22+
_arg_defaults = ScapDatabaseWriteWorker._arg_defaults
2323
"Default values for optional arguments."
2424

2525
@classmethod

greenbone/scap/generic_cli/worker/db.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
DEFAULT_POSTGRES_DATABASE_NAME,
1515
DEFAULT_POSTGRES_HOST,
1616
DEFAULT_POSTGRES_PORT,
17+
DEFAULT_VERBOSITY,
1718
CLIError,
1819
)
1920
from ...db import PostgresDatabase
@@ -45,12 +46,16 @@ class ScapDatabaseWriteWorker(BaseScapWorker[T]):
4546
"""
4647

4748
_item_type_plural = BaseScapWorker._item_type_plural
49+
"Plural form of the type of items to use in log messages."
50+
4851
_arg_defaults = {
4952
"database_name": DEFAULT_POSTGRES_DATABASE_NAME,
5053
"database_host": DEFAULT_POSTGRES_HOST,
5154
"database_port": DEFAULT_POSTGRES_PORT,
5255
"database_schema": None,
56+
"verbose": DEFAULT_VERBOSITY,
5357
}
58+
"Default values for optional arguments."
5459

5560
@classmethod
5661
def add_args_to_parser(
@@ -232,6 +237,7 @@ async def _loop_start(self) -> None:
232237

233238
async def __aenter__(self):
234239
await self._database.__aenter__()
240+
await self._manager.__aenter__()
235241
return self
236242

237243
async def __aexit__(self, exc_type, exc_val, exc_tb):

0 commit comments

Comments
 (0)