From f9bc01484edb05a8c9d4048a3d1f069b655ae42e Mon Sep 17 00:00:00 2001 From: ChanochShayner <57212002+ChanochShayner@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:00:14 +0300 Subject: [PATCH] fix(terraform): Module from_dict func to static func (#5562) fix --- checkov/terraform/graph_builder/graph_components/module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/checkov/terraform/graph_builder/graph_components/module.py b/checkov/terraform/graph_builder/graph_components/module.py index e553ab6c18e..8b67f9cb1e4 100644 --- a/checkov/terraform/graph_builder/graph_components/module.py +++ b/checkov/terraform/graph_builder/graph_components/module.py @@ -61,9 +61,10 @@ def to_dict(self) -> dict[str, Any]: 'blocks': [block.to_dict() for block in self.blocks] } - def from_dict(self, module_dict: dict[str, Any]) -> Module: + @staticmethod + def from_dict(module_dict: dict[str, Any]) -> Module: module = Module(source_dir=module_dict.get('source_dir', ''), - external_modules_source_map=self._from_dict_external_modules_source_map(module_dict) + external_modules_source_map=Module._from_dict_external_modules_source_map(module_dict) ) module.blocks = [TerraformBlock.from_dict(block) for block in module_dict.get('blocks', [])] module.path = module_dict.get('path', '')