-
Notifications
You must be signed in to change notification settings - Fork 341
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
s3_object put with metadata specifying Content-Type results in ContentType being None (and boto3 raising exception) #1881
Comments
timdiggins
added a commit
to timdiggins/amazon.aws
that referenced
this issue
Nov 27, 2023
fix erroneous change to meaning fixes ansible-collections#1881
timdiggins
added a commit
to timdiggins/amazon.aws
that referenced
this issue
Nov 27, 2023
commit 311250b Author: Tim Diggins <[email protected]> Date: Mon Nov 27 16:52:01 2023 +0000 optional refactoring to make intention more crisp commit 65b93a2 Author: Tim Diggins <[email protected]> Date: Mon Nov 27 16:43:18 2023 +0000 rename method to more accurately reflect action commit d9f9dbd Author: Tim Diggins <[email protected]> Date: Mon Nov 27 16:38:22 2023 +0000 allow s3_object put to specify metadata again fix erroneous change to meaning fixes ansible-collections#1881
tremble
pushed a commit
to timdiggins/amazon.aws
that referenced
this issue
Nov 29, 2023
fix erroneous change to meaning fixes ansible-collections#1881
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Nov 29, 2023
allow s3_object put to specify metadata again fix erroneous change to meaning fixes #1881 optional extra refactorings as separate commits (happy to drop these if unwanted) Reviewed-by: Mark Chappell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
If I want to upload a file with a specific content-type, then I will set the metadata to have Content-Type:
however this causes the following kind of error:
Traceback
This seems to be because this following code:
https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/s3_object.py#L750
replaces
extra["ContentType"]
with the return value ofget_content_type
which, whenpresent = truthy
implicitly returns None:https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/s3_object.py#L657-L665
This was introduced in #1193 -- I have added the following comment: https://github.com/ansible-collections/amazon.aws/pull/1193/files#r1406429232
Issue Type
Bug Report
Component Name
s3_object
Ansible Version
Collection Versions
AWS SDK versions
Configuration
$ ansible-config dump --only-changed
OS / Environment
No response
Steps to Reproduce
Expected Results
I expected the file to be uploaded with a content type of application/json
Actual Results
Error in Boto3 because ContentType is passed as None
Code of Conduct
The text was updated successfully, but these errors were encountered: