Skip to content

Commit

Permalink
Merged in hotfix/OPT-356 (pull request #90)
Browse files Browse the repository at this point in the history
[OPT-356] to main

Approved-by: David Fernandez Vigo
  • Loading branch information
rmenciac authored and dfernandezvigo committed Aug 22, 2022
2 parents 7a624b9 + b6e2890 commit 21c687c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions startleft/iac/mapping/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ def __get_parent_names(self, source_model, source_object, id_parents, component_
else:
parent = [get_resource_name_from_resource_reference(parent) if is_terraform_resource_reference(parent) else parent]

if parent is None:
parent = [DEFAULT_TRUSTZONE]

return parent, parents_from_component

def __get_parent_id(self, parent_element, parents_from_component, component_name):
Expand Down
5 changes: 2 additions & 3 deletions startleft/iac/mapping/sourcemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,10 @@ def __search_with_default(self, obj, source, action):

def __jmespath_search(self, search_path, source):
try:
search = jmespath.search(search_path, source, options=self.jmespath_options)
return jmespath.search(search_path, source, options=self.jmespath_options)

return search if search is not None else []
except:
return []
return None

def __find_first_search(self, search_path_root, source):
for search_path in search_path_root:
Expand Down

0 comments on commit 21c687c

Please sign in to comment.