r104 is broken - reverting to r103
This commit is contained in:
parent
6b54d0eab0
commit
040aa5dee3
@ -134,14 +134,3 @@ class KeystoneContext(context.OSContextGenerator):
|
|||||||
resolve_address(ADMIN),
|
resolve_address(ADMIN),
|
||||||
api_port('keystone-admin')).rstrip('v2.0')
|
api_port('keystone-admin')).rstrip('v2.0')
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
||||||
|
|
||||||
class KeystoneLoggingContext(context.OSContextGenerator):
|
|
||||||
|
|
||||||
def __call__(self):
|
|
||||||
ctxt = {}
|
|
||||||
debug = config('debug')
|
|
||||||
if debug and debug.lower() in ['yes', 'true']:
|
|
||||||
ctxt['root_level'] = 'DEBUG'
|
|
||||||
|
|
||||||
return ctxt
|
|
||||||
|
@ -100,7 +100,6 @@ API_PORTS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
KEYSTONE_CONF = "/etc/keystone/keystone.conf"
|
KEYSTONE_CONF = "/etc/keystone/keystone.conf"
|
||||||
KEYSTONE_LOGGER_CONF = "/etc/keystone/logging.conf"
|
|
||||||
KEYSTONE_CONF_DIR = os.path.dirname(KEYSTONE_CONF)
|
KEYSTONE_CONF_DIR = os.path.dirname(KEYSTONE_CONF)
|
||||||
STORED_PASSWD = "/var/lib/keystone/keystone.passwd"
|
STORED_PASSWD = "/var/lib/keystone/keystone.passwd"
|
||||||
STORED_TOKEN = "/var/lib/keystone/keystone.token"
|
STORED_TOKEN = "/var/lib/keystone/keystone.token"
|
||||||
@ -126,10 +125,6 @@ BASE_RESOURCE_MAP = OrderedDict([
|
|||||||
context.BindHostContext(),
|
context.BindHostContext(),
|
||||||
context.WorkerConfigContext()],
|
context.WorkerConfigContext()],
|
||||||
}),
|
}),
|
||||||
(KEYSTONE_LOGGER_CONF, {
|
|
||||||
'contexts': [keystone_context.KeystoneLoggingContext()],
|
|
||||||
'services': BASE_SERVICES,
|
|
||||||
}),
|
|
||||||
(HAPROXY_CONF, {
|
(HAPROXY_CONF, {
|
||||||
'contexts': [context.HAProxyContext(singlenode_mode=True),
|
'contexts': [context.HAProxyContext(singlenode_mode=True),
|
||||||
keystone_context.HAProxyContext()],
|
keystone_context.HAProxyContext()],
|
||||||
|
@ -1,69 +0,0 @@
|
|||||||
[loggers]
|
|
||||||
keys=root,access
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
keys=production,file,access_file,devel
|
|
||||||
|
|
||||||
[formatters]
|
|
||||||
keys=minimal,normal,debug
|
|
||||||
|
|
||||||
|
|
||||||
###########
|
|
||||||
# Loggers #
|
|
||||||
###########
|
|
||||||
|
|
||||||
[logger_root]
|
|
||||||
{% if root_level -%}
|
|
||||||
level={{ root_level }}
|
|
||||||
{% else -%}
|
|
||||||
level=WARNING
|
|
||||||
{% endif -%}
|
|
||||||
handlers=file
|
|
||||||
|
|
||||||
[logger_access]
|
|
||||||
level=INFO
|
|
||||||
qualname=access
|
|
||||||
handlers=access_file
|
|
||||||
|
|
||||||
|
|
||||||
################
|
|
||||||
# Log Handlers #
|
|
||||||
################
|
|
||||||
|
|
||||||
[handler_production]
|
|
||||||
class=handlers.SysLogHandler
|
|
||||||
level=ERROR
|
|
||||||
formatter=normal
|
|
||||||
args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
|
|
||||||
|
|
||||||
[handler_file]
|
|
||||||
class=handlers.WatchedFileHandler
|
|
||||||
level=WARNING
|
|
||||||
formatter=normal
|
|
||||||
args=('error.log',)
|
|
||||||
|
|
||||||
[handler_access_file]
|
|
||||||
class=handlers.WatchedFileHandler
|
|
||||||
level=INFO
|
|
||||||
formatter=minimal
|
|
||||||
args=('access.log',)
|
|
||||||
|
|
||||||
[handler_devel]
|
|
||||||
class=StreamHandler
|
|
||||||
level=NOTSET
|
|
||||||
formatter=debug
|
|
||||||
args=(sys.stdout,)
|
|
||||||
|
|
||||||
|
|
||||||
##################
|
|
||||||
# Log Formatters #
|
|
||||||
##################
|
|
||||||
|
|
||||||
[formatter_minimal]
|
|
||||||
format=%(message)s
|
|
||||||
|
|
||||||
[formatter_normal]
|
|
||||||
format=(%(name)s): %(asctime)s %(levelname)s %(message)s
|
|
||||||
|
|
||||||
[formatter_debug]
|
|
||||||
format=(%(name)s): %(asctime)s %(levelname)s %(module)s %(funcName)s %(message)s
|
|
@ -119,13 +119,3 @@ class TestKeystoneContexts(CharmTestCase):
|
|||||||
msg = "Multiple networks configured but net_type" \
|
msg = "Multiple networks configured but net_type" \
|
||||||
" is None (os-public-network)."
|
" is None (os-public-network)."
|
||||||
mock_log.assert_called_with(msg, level="WARNING")
|
mock_log.assert_called_with(msg, level="WARNING")
|
||||||
|
|
||||||
@patch.object(context, 'config')
|
|
||||||
def test_keystone_logger_context(self, mock_config):
|
|
||||||
ctxt = context.KeystoneLoggingContext()
|
|
||||||
|
|
||||||
mock_config.return_value = None
|
|
||||||
self.assertEqual({}, ctxt())
|
|
||||||
|
|
||||||
mock_config.return_value = 'True'
|
|
||||||
self.assertEqual({'root_level': 'DEBUG'}, ctxt())
|
|
||||||
|
Loading…
Reference in New Issue
Block a user