Skip to content

Commit

Permalink
Merge branch 'issue-460-script-bug-indexerror-list-index-out-of-range…
Browse files Browse the repository at this point in the history
…' into 'release-2.7.1'

Fixed Index Out of Range issue in __search_resources_in_root_compartment

See merge request nace-shared-services/cis-oci-landing-zone!304
  • Loading branch information
andrecorreaneto committed Jan 4, 2024
2 parents d28f12e + f2cf9dc commit 1211ce7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/cis_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -3375,13 +3375,17 @@ def __search_resources_in_root_compartment(self):

for item in structured_search_all_resources:
# ignoring global resources like IAM
if item.identifier.split('.')[3]:
record = {
"display_name": item.display_name,
"id": item.identifier,
"region": region_key
}
self.cis_foundations_benchmark_1_2['5.2']['Total'].append(item)
try:
if item.identifier.split('.')[3]:
record = {
"display_name": item.display_name,
"id": item.identifier,
"region": region_key
}
self.cis_foundations_benchmark_1_2['5.2']['Total'].append(item)
except:
self.__errors.append({"id" : "search_resources_in_root_compartment Invalid OCID", "error" : str(item)})
debug(f'__search_resources_in_root_compartment: Invalid OCID: {str(item)}')

except Exception as e:
raise RuntimeError(
Expand Down

0 comments on commit 1211ce7

Please sign in to comment.