fix(logging): ensuring loading default without dup

- updated load of default logging values in cli/api

Closes #148

Change-Id: I758d70a8175d4f96f919e0e79238b1a16c1025ba
This commit is contained in:
gardlt 2017-12-01 18:47:53 +00:00 committed by Alexis Rivera DeLa Torre
parent 76906751f6
commit 8ac4a106f9
4 changed files with 8 additions and 3 deletions

View File

@ -23,6 +23,7 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from armada import const from armada import const
from armada.conf import set_default_for_default_log_levels
CONF = cfg.CONF CONF = cfg.CONF
@ -31,8 +32,7 @@ class BaseResource(object):
def __init__(self): def __init__(self):
if not (os.path.exists(const.CONFIG_PATH)): if not (os.path.exists(const.CONFIG_PATH)):
logging.register_options(CONF) set_default_for_default_log_levels()
logging.set_defaults(default_log_levels=CONF.default_log_levels)
logging.setup(CONF, 'armada') logging.setup(CONF, 'armada')
self.logger = logging.getLogger(__name__) self.logger = logging.getLogger(__name__)

View File

@ -17,7 +17,9 @@ from oslo_log import log as logging
from armada import conf from armada import conf
conf.set_app_default_configs() conf.set_app_default_configs()
conf.set_default_for_default_log_levels()
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -28,7 +28,6 @@ if (os.path.exists(const.CONFIG_PATH)):
def set_app_default_configs(): def set_app_default_configs():
set_default_for_default_log_levels()
default.register_opts(CONF) default.register_opts(CONF)

View File

@ -10,6 +10,10 @@
# The default Keystone authentication url. (string value) # The default Keystone authentication url. (string value)
#auth_url = http://0.0.0.0/v3 #auth_url = http://0.0.0.0/v3
# Absolute path to the certificate file to use for chart registries (string
# value)
#certs = <None>
# Path to Kubernetes configurations. (string value) # Path to Kubernetes configurations. (string value)
#kubernetes_config_path = /home/user/.kube/ #kubernetes_config_path = /home/user/.kube/