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

Allow missing SERVER_SOFTWARE in appengine checks #1479

Closed
wants to merge 1 commit into from

Conversation

pquentin
Copy link
Member

Closes #1470

I've taken inspiration from #1470, #1471 and https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server#detecting_application_runtime_environment. The tests pass, but does it fix @wittfabian's original issue? I don't know.

@codecov-io
Copy link

codecov-io commented Nov 23, 2018

Codecov Report

Merging #1479 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1479   +/-   ##
=======================================
  Coverage   69.05%   69.05%           
=======================================
  Files          22       22           
  Lines        2682     2682           
=======================================
  Hits         1852     1852           
  Misses        830      830
Impacted Files Coverage Δ
src/urllib3/contrib/_appengine_environ.py 58.82% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3aebd4...557cee6. Read the comment docs.

@wittfabian
Copy link

This corresponds to the original solution from #1470.

@pquentin
Copy link
Member Author

@wittfabian It does! But does it help with your problem?

@wittfabian
Copy link

No, because if SERVER_SOFTWARE is not defined, both methods return False.

See: https://github.com/potatolondon/djangae/blob/master/djangae/environment.py#L50

@pquentin
Copy link
Member Author

Okay, I understand now. So we want to support that, we need to make sure that having is_local_appengine return True does not break anything else. Indeed, at least in tests, contrary to djangae, we not only want to differentiate local appengine from production appengine, but we also want to detect "not running in appengine at all".

@pquentin pquentin closed this Nov 23, 2018
@pquentin pquentin deleted the appengine-software branch November 23, 2018 14:17
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.

contrib/_appengine_environ.py KeyError SERVER_SOFTWARE
3 participants