Skip to content
Snippets Groups Projects
Commit 04275d31 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: use logger instead of print; cosmetics

parent ac5b6df7
No related branches found
No related tags found
No related merge requests found
......@@ -32,13 +32,13 @@ from builtins import str # pylint: disable=redefined-builtin
from errno import EPIPE as BrokenPipe
from socket import error as SocketError
from caosdb.version import version
from caosdb.configuration import get_config
from caosdb.exceptions import (AuthorizationException, CaosDBException,
ClientErrorException, ConfigurationException,
ConnectionException, EntityDoesNotExistError,
LoginFailedException, ServerErrorException,
URITooLongException)
from caosdb.version import version
from pkg_resources import resource_filename
from .interface import CaosDBHTTPResponse, CaosDBServerConnection
......@@ -178,10 +178,10 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
context.verify_mode = ssl.CERT_REQUIRED
if config.get("ssl_insecure"):
print("*** Warning! ***\n"
"Insecure SSL mode, certificate will not be checked! "
"Please consider removing the `ssl_insecure` configuration option.\n"
"****************", file=sys.stderr)
_LOGGER.warn("*** Warning! ***\n"
"Insecure SSL mode, certificate will not be checked! "
"Please consider removing the `ssl_insecure` configuration option.\n"
"****************", file=sys.stderr)
context.verify_mode = ssl.CERT_NONE
if (not context.verify_mode == ssl.CERT_NONE and
......@@ -347,13 +347,16 @@ def configure_connection(**kwargs):
# 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment