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

Layer Downloader now looks for AWS_CA_BUNDLE if it exists #1143

Merged
merged 2 commits into from
Apr 29, 2019

Conversation

DevOpsChris
Copy link
Contributor

@DevOpsChris DevOpsChris commented Apr 23, 2019

Issue #, if available: #917

Description of changes: This enables the layer downloader to us AWS_CA_BUNDLE environment variable if it exists. It defaults to SSL verify True if it doesn't.

Checklist:

  • Write Design Document - No. Doesn't meet reqs. (Do I need to write a design document?)
  • Write unit tests
  • Write/update functional tests
  • Write/update integration tests
  • make pr passes
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@DevOpsChris
Copy link
Contributor Author

I notice that tox runs the make pr command. Is that sufficient, or do I run it alone on my dev box?

Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

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

This looks good over all. I just request a unit test that can verify we are reading the AWS_CA_BUNDLE env var properly and passing its value to the requests call. Mocking out os.environ to return a dictionary with this key and value is enough.

tests/unit/local/lambdafn/test_zip.py Show resolved Hide resolved
@DevOpsChris
Copy link
Contributor Author

I plan on squashing once the testing is good.

- Added unittest to verify ssl download for Layer Downloader
- Mocked os.environ for lack of AWS_CA_BUNDLE for layer downloading
- Updated Development guide, howto run unittest with one python version
@DevOpsChris
Copy link
Contributor Author

Squashed & rebased on latest upstream/develop commit

@DevOpsChris
Copy link
Contributor Author

I'm ready once the test passes

@jfuss
Copy link
Contributor

jfuss commented Apr 29, 2019

Hey @DevOpsChris, I pushed a patch to your branch. The os.environ patch was not patching the environ correctly in the module. I spent some time trying to use the @patch.dict but I could not get it to work. So I ended up patching os in the module and mocking out the return value. I also added a tests that read the value and expected that request.get had the correct value for verify.

I will merge once the tests pass on Travis. Thanks for spending the time on this.

@DevOpsChris
Copy link
Contributor Author

Hey thank you for finding that quirk out. It looks like Travis is temperamental, it failed on a Go language test. I recommend re-testing it, it seems to make it work again. I wonder if it's a virtual machine timeout issue.

@jfuss jfuss merged commit c05af5e into aws:develop Apr 29, 2019
@jfuss
Copy link
Contributor

jfuss commented Apr 29, 2019

@DevOpsChris this happens from time to time. It's unclear why but playing whack-a-mole (rerunning) is our current way around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants