Skip to content

Commit

Permalink
fix(terraform): Module from_dict func to static func (#5562)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
ChanochShayner committed Sep 13, 2023
1 parent cf81609 commit f9bc014
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions checkov/terraform/graph_builder/graph_components/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down

0 comments on commit f9bc014

Please sign in to comment.