Skip to content

Commit

Permalink
fix(hcl_handler): Skip modules without version attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Noahnc committed Nov 29, 2023
1 parent 229c644 commit 52fb4ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions infrapatch/core/utils/terraform/hcl_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def _get_terraform_modules_from_dict(self, terraform_file_dict: dict, tf_file: P
if "source" not in value:
log.debug(f"Skipping module '{module_name}' because it has no source attribute.")
continue
if "version" not in value:
log.debug(f"Skipping module '{module_name}' because it has no version attribute.")
continue
found_resources.append(TerraformModule(name=module_name, _source=value["source"], current_version=value["version"], _source_file=tf_file.absolute().as_posix()))
return found_resources

Expand Down

0 comments on commit 52fb4ba

Please sign in to comment.