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

Remote AWS Environment Variables code example in README makes no sense #1273

Closed
texonidas opened this issue Sep 13, 2023 · 3 comments · Fixed by #1281
Closed

Remote AWS Environment Variables code example in README makes no sense #1273

texonidas opened this issue Sep 13, 2023 · 3 comments · Fixed by #1281
Assignees
Labels
documentation Improvements or additions to documentation has-pr

Comments

@texonidas
Copy link
Contributor

Context

The code shown in this section appears to be checking that the code isn't running locally?
if 'SERVERTYPE' in os.environ and os.environ['SERVERTYPE'] == 'AWS Lambda':
appears to be a check that the code is running in Lambda, when it should fully inverted as far as I can tell? I'm happy to fix this myself, I just want to ensure I am correctly interpreting what's happening here.

Expected Behavior

N/A

Actual Behavior

N/A

Possible Fix

not the if

Steps to Reproduce

N/A

Your Environment

N/A

@javulticat javulticat self-assigned this Nov 5, 2023
@javulticat
Copy link
Member

Hey @texonidas, thanks for the report. I agree with you - this code example in the README doesn't make sense to me. In addition to the issue you pointed out, in the very next line it calls import os, but the os module would clearly have to been already imported since the line before is already using os.environ... 🙄

Unfortunately, this portion of the README is 6 years old, so I have no idea what the original author was thinking. But, I'm convinced it should be changed, so I will be altering that line to provide an example of the modern canonical check for whether code is running in the Lambda runtime environment or not. Hope that will clear things up for everyone!

@javulticat javulticat added documentation Improvements or additions to documentation easy-fix has-pr labels Nov 5, 2023
@javulticat
Copy link
Member

PR with the fix is here: #1281 - we should be able to get that merged and included in the next release. Thanks again for pointing it out!

@texonidas
Copy link
Contributor Author

Thank you! Muuuuuch clearer now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation has-pr
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants