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

fix: make scanners respect --no-properties also when connected to a database. #538

Merged
merged 1 commit into from
Jun 20, 2024
Merged
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
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