From 301f75e7fe20a6d7096df7a8affc7e85e045697a Mon Sep 17 00:00:00 2001 From: fabian Date: Tue, 3 Dec 2024 17:51:58 +0100 Subject: [PATCH 1/2] fix(config): Copy init_kwargs to avoid potentially surprising side effects when resuing with multiple configs --- src/gallia/command/config.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gallia/command/config.py b/src/gallia/command/config.py index 393e29604..2bd500d8f 100644 --- a/src/gallia/command/config.py +++ b/src/gallia/command/config.py @@ -301,11 +301,8 @@ class GalliaBaseModel(BaseCommand, ABC): __config_registry: dict[str, tuple[str, Any]] def __init__(self, **data: Any): - init_kwargs = data.pop("init_kwargs", {}) - - if init_kwargs is None: - init_kwargs = {} - + # Copy to avoid side effects when reusing init_kwargs + init_kwargs = dict(data.pop("init_kwargs", {})) init_kwargs.update(data) super().__init__(**init_kwargs) From cc9a2d46c862ead5437d23bd8c1fde006b08644a Mon Sep 17 00:00:00 2001 From: fabian Date: Tue, 3 Dec 2024 18:03:17 +0100 Subject: [PATCH 2/2] Mark currently not used parameter --- src/gallia/commands/scan/uds/services.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallia/commands/scan/uds/services.py b/src/gallia/commands/scan/uds/services.py index 03bab17f8..40d503fe5 100644 --- a/src/gallia/commands/scan/uds/services.py +++ b/src/gallia/commands/scan/uds/services.py @@ -30,7 +30,9 @@ class ServicesScannerConfig(UDSScannerConfig): False, description="check current session; only takes affect if --sessions is given" ) scan_response_ids: bool = Field(False, description="Include IDs in scan with reply flag set") - auto_reset: bool = Field(False, description="Reset ECU with UDS ECU Reset before every request") + auto_reset: bool = Field( + False, description="Reset ECU with UDS ECU Reset before every request" + ) # FIXME: Currently not in use skip: Ranges2D = Field( {}, metavar="SESSION_ID:ID",