Skip to content

Commit 4c09070

Browse files
committed
fix: make scanners respect --no-properties also when connected to a database.
1 parent 3d33e23 commit 4c09070

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/gallia/command/uds.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,15 @@ async def setup(self, args: Namespace) -> None:
162162
await file.write("\n")
163163

164164
if self.db_handler is not None:
165-
try:
166-
await self.db_handler.insert_scan_run_properties_pre(await self.ecu.properties())
167-
self._apply_implicit_logging_setting()
168-
except Exception as e:
169-
logger.warning(f"Could not write the properties_pre to the database: {e!r}")
165+
self._apply_implicit_logging_setting()
166+
167+
if args.properties is True:
168+
try:
169+
await self.db_handler.insert_scan_run_properties_pre(
170+
await self.ecu.properties()
171+
)
172+
except Exception as e:
173+
logger.warning(f"Could not write the properties_pre to the database: {e!r}")
170174

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

185-
if self.db_handler is not None:
189+
if self.db_handler is not None and args.properties is True:
186190
try:
187191
await self.db_handler.complete_scan_run(await self.ecu.properties(False))
188192
except Exception as e:

0 commit comments

Comments
 (0)