Skip to content

Commit

Permalink
Modify NO_GCE_CHECK to be a global variable that default on an env var
Browse files Browse the repository at this point in the history
Following @craigcitro's suggestion
  • Loading branch information
aaronwinter committed Jan 22, 2015
1 parent 7c1b2c7 commit ac61423
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauth2client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
DEFAULT_ENV_NAME = 'UNKNOWN'

# If set to True _get_environment avoid GCE check (_detect_gce_environment)
NO_GCE_CHECK = False
NO_GCE_CHECK = os.environ.setdefault('NO_GCE_CHECK', 'False')

class SETTINGS(object):
"""Settings namespace for globally defined values."""
Expand Down Expand Up @@ -974,7 +974,7 @@ def _get_environment(urlopen=None):
SETTINGS.env_name = 'GAE_PRODUCTION'
elif server_software.startswith('Development/'):
SETTINGS.env_name = 'GAE_LOCAL'
elif NO_GCE_CHECK is not True and _detect_gce_environment(urlopen=urlopen):
elif NO_GCE_CHECK is not 'True' and _detect_gce_environment(urlopen=urlopen):
SETTINGS.env_name = 'GCE_PRODUCTION'

return SETTINGS.env_name
Expand Down

0 comments on commit ac61423

Please sign in to comment.