Skip to content

Commit

Permalink
Merge pull request #451 from h00die/ecs__enum_crash
Browse files Browse the repository at this point in the history
fix ecs__enum crash on permission denied
  • Loading branch information
DaveYesland authored Nov 14, 2024
2 parents 993d9ca + c7fe59f commit b801700
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pacu/modules/ecs__enum/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def main(args, pacu_main):
response = client.list_clusters()
except ClientError as error:
code = error.response['Error']['Code']
response = {}
print('FAILURE: ')
if code == 'UnauthorizedOperation':
print(' Access denied to ListClusters.')
Expand All @@ -113,7 +114,7 @@ def main(args, pacu_main):
else:
response = client.list_clusters()

for arn in response['clusterArns']:
for arn in response.get('clusterArns', []):
clusters.append(arn)
print(' {} cluster arn(s) found.'.format(len(clusters)))
all_clusters += clusters
Expand Down

0 comments on commit b801700

Please sign in to comment.