Check the config value for core.ssl_verify (#651)
This commit is contained in:
committed by
tamarrow
parent
00406f4a48
commit
6031c4dda8
@@ -67,7 +67,7 @@ def get_config_val(name, config=None):
|
||||
:param config: config
|
||||
:type config: Toml
|
||||
:returns: value of 'name' parameter
|
||||
:rtype: object | None
|
||||
:rtype: str | None
|
||||
"""
|
||||
|
||||
if config is None:
|
||||
@@ -78,9 +78,9 @@ def get_config_val(name, config=None):
|
||||
env_var = None
|
||||
if section == "CORE":
|
||||
if subkey.startswith("DCOS") and os.environ.get(subkey):
|
||||
env_var = subkey
|
||||
env_var = subkey
|
||||
else:
|
||||
env_var = "DCOS_{}".format(subkey)
|
||||
env_var = "DCOS_{}".format(subkey)
|
||||
else:
|
||||
env_var = "DCOS_{}_{}".format(section, subkey)
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ def _verify_ssl(verify=None):
|
||||
|
||||
if verify is None:
|
||||
verify = config.get_config_val("core.ssl_verify")
|
||||
if verify.lower() == "true":
|
||||
if verify and verify.lower() == "true":
|
||||
verify = True
|
||||
elif verify.lower() == "false":
|
||||
elif verify and verify.lower() == "false":
|
||||
verify = False
|
||||
|
||||
return verify
|
||||
|
||||
Reference in New Issue
Block a user