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

Autopopulate CopySourceSSECustomerKeyMD5 for s3 #709

Merged
merged 2 commits into from
Nov 4, 2015

Conversation

kyleknap
Copy link
Contributor

@kyleknap kyleknap commented Nov 4, 2015

This is implementing logic used for this PR: aws/aws-cli#1487. We have it for SSECustomer members but not the copy source one which may be needed when calling CopyObject.

cc @jamesls @mtdowling @rayluo @JordonPhillips

@kyleknap kyleknap added the pr/needs-review This PR needs a review from a member of the team. label Nov 4, 2015
@JordonPhillips
Copy link
Contributor

Looks good to me 🚢

return (params.get('SSECustomerKey') is not None and
'SSECustomerKeyMD5' not in params)
def _needs_s3_sse_customization(params, sse_member_prefix='SSECustomer'):
return (params.get(sse_member_prefix+'Key') is not None and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we typically include spaces between operators

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm flake8 did not catch that. I am changing it, but for future references, there are some nuances to that rule in pep8 if you have multiple operators on the same line: https://www.python.org/dev/peps/pep-0008/#other-recommendations.

@mtdowling
Copy link
Contributor

🚢

def _needs_s3_sse_customization(params):
return (params.get('SSECustomerKey') is not None and
'SSECustomerKeyMD5' not in params)
def _needs_s3_sse_customization(params, sse_member_prefix='SSECustomer'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason this needs to have a default value if we're always providing it when we call _needs_s3_sse_customization?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah we do not need a default. Just forgot to remove it upon implementation.

@kyleknap
Copy link
Contributor Author

kyleknap commented Nov 4, 2015

@jamesls I updated. Let me know what you think.

@jamesls
Copy link
Member

jamesls commented Nov 4, 2015

:shipit:

kyleknap added a commit that referenced this pull request Nov 4, 2015
Autopopulate CopySourceSSECustomerKeyMD5 for s3
@kyleknap kyleknap merged commit f08fa9c into boto:develop Nov 4, 2015
@kyleknap kyleknap deleted the sse-c-copy-source branch November 4, 2015 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/needs-review This PR needs a review from a member of the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants