Skip to content

Commit 036a3ab

Browse files
committed
Proper defaulting of osiType, minor review fixes
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent d463c71 commit 036a3ab

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

qc_ositrace/checks/osirules/osirules_checker.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,17 +362,14 @@ def run_checks(config: Configuration, result: Result) -> None:
362362
[int(s) for s in osirules_constants.OSI_FALLBACK_VERSION.split(".")]
363363
)
364364
expected_type_name = config.get_config_param("osiType") or "SensorView"
365-
expected_type = OSITrace.map_message_type(expected_type_name)
366365

367-
trace = OSITrace(
368-
config.get_config_param("InputFile"), config.get_config_param("osiType")
369-
)
366+
trace = OSITrace(config.get_config_param("InputFile"), expected_type_name)
370367

371368
result.register_checker(
372369
checker_bundle_name=constants.BUNDLE_NAME,
373370
checker_id=osirules_constants.CHECKER_ID,
374371
description="Evaluates messages in the trace file against the OSI Rules of the given OSI version to guarantee they are in conformance with the standard OSI rules.",
375-
summary=f"Checker validating OSI Rules compliance of messages in a trace file",
372+
summary="Checker validating OSI Rules compliance of messages in a trace file",
376373
)
377374

378375
if expected_version is None:
@@ -451,7 +448,7 @@ def run_checks(config: Configuration, result: Result) -> None:
451448
time,
452449
version_rule_uid,
453450
IssueSeverity.ERROR,
454-
description=f"Version field is not set in top-level message.",
451+
description="Version field is not set in top-level message.",
455452
)
456453
elif (
457454
expected_version is not None

qc_ositrace/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def main():
9292
config = Configuration()
9393
if args.default_config:
9494
logging.info("Using default configuration")
95+
config.set_config_param("osiType", "SensorView")
9596
config.register_checker_bundle(checker_bundle_name=constants.BUNDLE_NAME)
9697
else:
9798
config.load_from_file(xml_file_path=args.config_path)

0 commit comments

Comments
 (0)