Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #1538/94bb14c2 backport][stable-6] s3_bucket: fix VersionId==null when s3 object not versioned #1545

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented May 11, 2023

This is a backport of PR #1538 as merged into main (94bb14c).

SUMMARY

Boto3 1.26.129 (possibly earlier) returns "VersionId": "null" from s3_client.list_object_versions() when s3 objects are not versioned. Previously, "VersionId" was None when an s3 object was not versioned. This change broke s3_bucket.destroy_bucket() because the the VersionId was no longer popped (line 1166) when the s3 object was not versioned, and the subsequent attempts to delete the s3 object failed as the "VersionId" was absolutely not "null". Adding in `or fk.get("VersionId")=="null" will catch this new value for non-versioned s3 objects while allowing backwards compatibility with previous versions that return None for "VersionId".

Fixes #1533 s3_bucket.destroy_bucket fails to delete unversioned items

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

s3_bucket.py

ADDITIONAL INFORMATION
  1. Ensure that there is an s3 bucket with objects in it
  • name: Remove buckets
    s3_bucket:
    name: "my_bucket_with_objects_with_no_versioning"
    state: absent
    force: yes

s3_bucket: fix VersionId==null when s3 object not versioned

SUMMARY

Boto3 1.26.129 (possibly earlier) returns "VersionId": "null" from s3_client.list_object_versions() when s3 objects are not versioned.  Previously, "VersionId" was None when an s3 object was not versioned.  This change broke s3_bucket.destroy_bucket() because the the VersionId was no longer popped (line 1166) when the s3 object was not versioned, and the subsequent attempts to delete the s3 object failed as the "VersionId" was absolutely not "null".  Adding in `or fk.get("VersionId")=="null" will catch this new value for non-versioned s3 objects while allowing backwards compatibility with previous versions that return None for "VersionId".

Fixes #1533 s3_bucket.destroy_bucket fails to delete unversioned items
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

s3_bucket.py
ADDITIONAL INFORMATION

Ensure that there is an s3 bucket with objects in it

name: Remove buckets
s3_bucket:
name: "my_bucket_with_objects_with_no_versioning"
state: absent
force: yes

Reviewed-by: Mark Chappell
(cherry picked from commit 94bb14c)
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/cd79683db4494b73984295c399d71551

✔️ ansible-galaxy-importer SUCCESS in 4m 21s
✔️ build-ansible-collection SUCCESS in 12m 34s
✔️ ansible-test-splitter SUCCESS in 4m 45s
✔️ integration-amazon.aws-1 SUCCESS in 8m 32s
Skipped 43 jobs

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label May 11, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/e86fdc7b015f432cbb2b81982f2983f3

✔️ ansible-galaxy-importer SUCCESS in 4m 10s
✔️ build-ansible-collection SUCCESS in 13m 12s
✔️ ansible-test-splitter SUCCESS in 4m 51s
✔️ integration-amazon.aws-1 SUCCESS in 10m 05s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 58034bf into stable-6 May 11, 2023
@softwarefactory-project-zuul softwarefactory-project-zuul bot deleted the patchback/backports/stable-6/94bb14c207215f83d8c5c6939ed177be30f5f8df/pr-1538 branch May 11, 2023 18:11
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
Bump main to 6.0.0-dev0

SUMMARY
With stable-5 branched, we can bump main to 6.0.0-dev0 and start landing breaking changes
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
galaxy.yml
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants