Fixed ACL user comparison. Resolves #33754. #33776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the change detection of
states.boto_s3_bucket.present
.What issues does this PR fix or reference?
This PR hopefully resolves #33754, but as there are other possible causes for that problem, the reporter will need to confirm. In my particular case at least, it fixes the problem described in #33754.
Previous Behavior
states.boto_s3_bucket.present
was idempotent with respect to actual bucket settings, but in certain cases it would detect changes when there were none. This resulted in unnecessary API requests and incorrect output.The problem lay in bucket ACL descriptions. When specifying an ACL to the AWS API, each user description must include a
Type
key (usually set toCanonicalUser
). But when you query the API for an ACL, it sometimes omits theType
key. So the comparison between expected and received ACL descriptions was failing.New Behavior
We normalize all user descriptions before comparison, removing the
Type
key from them.Tests written?
Yes (just modified the unit test
test_present_when_bucket_exists_no_mods
that was already present)