Skip to content

Commit

Permalink
revert: do not use model_construct()
Browse files Browse the repository at this point in the history
  • Loading branch information
mtache committed Jan 7, 2025
1 parent 1e0a347 commit 303ae12
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions anta/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,7 @@ def __init__(
self.device: AntaDevice = device
self.inputs: AntaTest.Input
self.instance_commands: list[AntaCommand] = []
self.result: TestResult = TestResult(
name=device.name,
test=self.name,
categories=self.categories,
description=self.description,
)
self.result: TestResult = TestResult(name=device.name, test=self.name, categories=self.categories, description=self.description, inputs=None)
self._init_inputs(inputs)
if self.result.result == AntaTestStatus.UNSET:
self._init_commands(eos_data)
Expand Down Expand Up @@ -483,7 +478,7 @@ def _init_inputs(self, inputs: dict[str, Any] | AntaTest.Input | None) -> None:
if res_ow.description:
self.result.description = res_ow.description
self.result.custom_field = res_ow.custom_field
self.result.inputs = self.inputs.__class__.model_construct(**self.inputs.model_dump(mode="json"))
self.result.inputs = self.inputs

def _init_commands(self, eos_data: list[dict[Any, Any] | str] | None) -> None:
"""Instantiate the `instance_commands` instance attribute from the `commands` class attribute.
Expand Down

0 comments on commit 303ae12

Please sign in to comment.