Remove usage of os.environ.setdefault (#621)
This is somewhat misleading, since it doesn't change the value of the env. var. in the shell.
This commit is contained in:
committed by
Jon Wayne Parrott
parent
5190fd70bb
commit
6a12a1fb58
@@ -99,13 +99,12 @@ AccessTokenInfo = collections.namedtuple(
|
|||||||
DEFAULT_ENV_NAME = 'UNKNOWN'
|
DEFAULT_ENV_NAME = 'UNKNOWN'
|
||||||
|
|
||||||
# If set to True _get_environment avoid GCE check (_detect_gce_environment)
|
# If set to True _get_environment avoid GCE check (_detect_gce_environment)
|
||||||
NO_GCE_CHECK = os.environ.setdefault('NO_GCE_CHECK', 'False')
|
NO_GCE_CHECK = os.getenv('NO_GCE_CHECK', 'False')
|
||||||
|
|
||||||
# Timeout in seconds to wait for the GCE metadata server when detecting the
|
# Timeout in seconds to wait for the GCE metadata server when detecting the
|
||||||
# GCE environment.
|
# GCE environment.
|
||||||
try:
|
try:
|
||||||
GCE_METADATA_TIMEOUT = int(
|
GCE_METADATA_TIMEOUT = int(os.getenv('GCE_METADATA_TIMEOUT', 3))
|
||||||
os.environ.setdefault('GCE_METADATA_TIMEOUT', '3'))
|
|
||||||
except ValueError: # pragma: NO COVER
|
except ValueError: # pragma: NO COVER
|
||||||
GCE_METADATA_TIMEOUT = 3
|
GCE_METADATA_TIMEOUT = 3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user