Skip to content

Commit b479a43

Browse files
remove library setting root logger configuration (#340)
Co-authored-by: Dan Chaffelson <[email protected]>
1 parent eeeee30 commit b479a43

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

nipyapi/config.py

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,27 @@
77
"""
88

99
from __future__ import absolute_import
10-
import logging
1110
import os
1211
import ssl
1312
import urllib3
1413
from nipyapi.nifi import configuration as nifi_config
1514
from nipyapi.registry import configuration as registry_config
1615

1716

18-
# --- Logging ------
19-
logging.basicConfig(level=logging.WARNING)
20-
21-
2217
# --- Default Host URLs -----
2318
# Note that changing the default hosts below will not
2419
# affect an API connection that's already running.
2520
# You'll need to change the .api_client.host for that, and there is a
2621
# convenience function for this in nipyapi.utils.set_endpoint
2722

2823
# Set Default Host for NiFi
29-
default_host = 'localhost' # Default to localhost for release
24+
default_host = "localhost" # Default to localhost for release
3025
#
3126
nifi_config.host = os.getenv(
32-
'NIFI_API_ENDPOINT',
33-
'http://' + default_host + ':8080/nifi-api'
27+
"NIFI_API_ENDPOINT", "http://" + default_host + ":8080/nifi-api"
3428
)
3529
# Set Default Host for NiFi-Registry
36-
registry_config.host = 'http://' + default_host + ':18080/nifi-registry-api'
30+
registry_config.host = "http://" + default_host + ":18080/nifi-registry-api"
3731

3832
# --- Project Root ------
3933
# Is is helpful to have a reference to the root directory of the project
@@ -100,21 +94,21 @@
10094
# --- Security Context
10195
# This allows easy reference to a set of certificates for use in automation
10296
# By default it points to our demo certs, change it for your environment
103-
default_certs_path = os.path.join(PROJECT_ROOT_DIR, 'demo/keys')
97+
default_certs_path = os.path.join(PROJECT_ROOT_DIR, "demo/keys")
10498
default_ssl_context = {
105-
'ca_file': os.path.join(default_certs_path, 'localhost-ts.pem'),
106-
'client_cert_file': os.path.join(default_certs_path, 'client-cert.pem'),
107-
'client_key_file': os.path.join(default_certs_path, 'client-key.pem'),
108-
'client_key_password': 'clientPassword'
99+
"ca_file": os.path.join(default_certs_path, "localhost-ts.pem"),
100+
"client_cert_file": os.path.join(default_certs_path, "client-cert.pem"),
101+
"client_key_file": os.path.join(default_certs_path, "client-key.pem"),
102+
"client_key_password": "clientPassword",
109103
}
110104
# Identities and passwords to be used for service login if called for
111-
default_nifi_username = 'nobel'
112-
default_nifi_password = 'password'
113-
default_registry_username = 'nobel'
114-
default_registry_password = 'password'
105+
default_nifi_username = "nobel"
106+
default_nifi_password = "password"
107+
default_registry_username = "nobel"
108+
default_registry_password = "password"
115109
# Identity to be used in the Registry Client Proxy setup
116110
# If called for during policy setup, particularly bootstrap_policies
117-
default_proxy_user = 'CN=localhost, OU=nifi'
111+
default_proxy_user = "CN=localhost, OU=nifi"
118112

119113
# Auth handling
120114
# If set, NiPyAPI will always include the Basic Authorization header
@@ -149,14 +143,14 @@
149143
registry_config.ssl_context.check_hostname = False
150144
registry_config.ssl_context.verify_mode = ssl.CERT_NONE
151145

152-
if os.getenv('NIFI_CA_CERT') is not None:
153-
nifi_config.ssl_ca_cert = os.getenv('NIFI_CA_CERT')
154-
nifi_config.cert_file = os.getenv('NIFI_CLIENT_CERT')
155-
nifi_config.key_file = os.getenv('NIFI_CLIENT_KEY')
146+
if os.getenv("NIFI_CA_CERT") is not None:
147+
nifi_config.ssl_ca_cert = os.getenv("NIFI_CA_CERT")
148+
nifi_config.cert_file = os.getenv("NIFI_CLIENT_CERT")
149+
nifi_config.key_file = os.getenv("NIFI_CLIENT_KEY")
156150

157151
# --- Encoding
158152
# URL Encoding bypass characters will not be encoded during submission
159-
default_safe_chars = ''
153+
default_safe_chars = ""
160154

161155
# Default String Encoding
162-
default_string_encoding = 'utf8'
156+
default_string_encoding = "utf8"

0 commit comments

Comments
 (0)