Skip to content

Commit

Permalink
fix: make scanners respect --no-properties also when connected to a d…
Browse files Browse the repository at this point in the history
…atabase.
  • Loading branch information
emedav authored and rumpelsepp committed Jun 20, 2024
1 parent 69ae8dd commit a308588
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/gallia/command/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,15 @@ async def setup(self, args: Namespace) -> None:
await file.write("\n")

if self.db_handler is not None:
try:
await self.db_handler.insert_scan_run_properties_pre(await self.ecu.properties())
self._apply_implicit_logging_setting()
except Exception as e:
logger.warning(f"Could not write the properties_pre to the database: {e!r}")
self._apply_implicit_logging_setting()

if args.properties is True:
try:
await self.db_handler.insert_scan_run_properties_pre(
await self.ecu.properties()
)
except Exception as e:
logger.warning(f"Could not write the properties_pre to the database: {e!r}")

async def teardown(self, args: Namespace) -> None:
if args.properties is True and not self.ecu.transport.is_closed:
Expand All @@ -182,7 +186,7 @@ async def teardown(self, args: Namespace) -> None:
if args.compare_properties and await self.ecu.properties(False) != prop_pre:
logger.warning("ecu properties differ, please investigate!")

if self.db_handler is not None:
if self.db_handler is not None and args.properties is True:
try:
await self.db_handler.complete_scan_run(await self.ecu.properties(False))
except Exception as e:
Expand Down

0 comments on commit a308588

Please sign in to comment.