Skip to content

Commit

Permalink
multiple inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
abraverm committed Jul 18, 2024
1 parent 82a3762 commit ba0d246
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/modules/s3_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
type: list
elements: dict
default: []
type: list
elements: dict
default: []
suboptions:
destination:
description: Contains information about where to publish the inventory results.
Expand Down Expand Up @@ -1165,8 +1168,10 @@ def get_bucket_inventories(s3_client, bucket_name: str) -> list:
result = s3_client.list_bucket_inventory_configurations(Bucket=bucket_name)
inventory_list = result.get("InventoryConfigurationList", [])
return inventory_list if inventory_list else []
return inventory_list if inventory_list else []
except is_boto3_error_code("NoSuchConfiguration"): # pylint: disable=duplicate-except
return []
return []


@AWSRetry.exponential_backoff(max_delay=120, catch_extra_error_codes=["NoSuchBucket", "OperationAborted"])
Expand Down

0 comments on commit ba0d246

Please sign in to comment.