Skip to content
Snippets Groups Projects
Commit 97b7ccb2 authored by Daniel's avatar Daniel
Browse files

Merge branch 'dev' into fix-default-cert

parents cbb4fdab 8bd1f1a4
No related branches found
No related tags found
No related merge requests found
......@@ -334,8 +334,21 @@ def configure_connection(**kwargs):
_Connection
The singleton instance of the _Connection class.
"""
global_conf = (dict(get_config().items("Connection")) if
get_config().has_section("Connection") else dict())
global_conf = {}
conf = get_config()
# Convert config to dict, with preserving types
int_opts = ["timeout"]
bool_opts = ["ssl_insecure"]
if conf.has_section("Connection"):
global_conf = dict(conf.items("Connection"))
# Integer options
for opt in int_opts:
if opt in global_conf:
global_conf[opt] = conf.getint("Connection", opt)
# Boolean options
for opt in bool_opts:
if opt in global_conf:
global_conf[opt] = conf.getboolean("Connection", opt)
local_conf = _make_conf(_DEFAULT_CONF, global_conf, kwargs)
connection = _Connection.get_instance()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment