Skip to content

Commit 688d0bf

Browse files
committed
Centralize osiType defaulting, warn in case of default
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent 184b0eb commit 688d0bf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

qc_ositrace/checks/osirules/osirules_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def run_checks(config: Configuration, result: Result) -> None:
361361
fallback_version = tuple(
362362
[int(s) for s in osirules_constants.OSI_FALLBACK_VERSION.split(".")]
363363
)
364-
expected_type_name = config.get_config_param("osiType") or "SensorView"
364+
expected_type_name = config.get_config_param("osiType")
365365

366366
trace = OSITrace(config.get_config_param("InputFile"), expected_type_name)
367367

qc_ositrace/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def main():
9292
config = Configuration()
9393
if args.default_config:
9494
logging.info("Using default configuration")
95-
config.set_config_param("osiType", "SensorView")
9695
config.register_checker_bundle(checker_bundle_name=constants.BUNDLE_NAME)
9796
else:
9897
config.load_from_file(xml_file_path=args.config_path)
@@ -122,6 +121,12 @@ def main():
122121
value=str(args.result_file),
123122
)
124123

124+
if config.get_config_param("osiType") is None:
125+
config.set_config_param("osiType", "SensorView")
126+
logging.warning(
127+
"No OSI Type specified, defaulting to SensorView. This may lead to unexpected results if it does not match the actual type."
128+
)
129+
125130
logging.info("Running OSI Trace checker bundle")
126131

127132
result = run_checker_bundle(config=config)

0 commit comments

Comments
 (0)