From 6031c4dda881720e3723c6a4d717655eb83d3657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Armando=20Garc=C3=ADa=20Sancio?= Date: Thu, 9 Jun 2016 10:43:10 -0700 Subject: [PATCH] Check the config value for core.ssl_verify (#651) --- dcos/config.py | 6 +++--- dcos/http.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dcos/config.py b/dcos/config.py index 2f6a854..ff172dd 100644 --- a/dcos/config.py +++ b/dcos/config.py @@ -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) diff --git a/dcos/http.py b/dcos/http.py index ffef302..81b99ae 100644 --- a/dcos/http.py +++ b/dcos/http.py @@ -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