Prepare for oslo.log 3.17.0

The 3.17.0 release of oslo.log changes the default value of "use_stderr"
to False (from True). We had tests that asserted that our glance-*
commands used stderr to provide information to administrators. This
works to preserve that default value for operators by overriding the
default to True when we're running in one of those commands.

We deliberately excluded glance-api, glance-glare, and glance-registry
because glance-api and glance-registry are usually not run manually and
they don't need to log to stderr by default and glance-glare is
deprecated.

Change-Id: Ia054f8f637c826280722c0d2a6811fdbc0cf54ed
This commit is contained in:
Ian Cordasco 2016-11-28 09:44:36 -06:00
parent 04b3339fac
commit b2cd0775ec
7 changed files with 20 additions and 0 deletions

View File

@ -47,6 +47,7 @@ from glance.image_cache import cleaner
CONF = config.CONF
logging.register_options(CONF)
CONF.set_default(name='use_stderr', default=True, enforce_type=True)
def main():

View File

@ -41,6 +41,7 @@ from glance.image_cache import prefetcher
CONF = config.CONF
logging.register_options(CONF)
CONF.set_default(name='use_stderr', default=True, enforce_type=True)
def main():

View File

@ -39,6 +39,7 @@ from glance.image_cache import pruner
CONF = config.CONF
logging.register_options(CONF)
CONF.set_default(name='use_stderr', default=True, enforce_type=True)
def main():

View File

@ -313,6 +313,7 @@ def main():
try:
logging.register_options(CONF)
CONF.set_default(name='use_stderr', default=True, enforce_type=True)
cfg_files = cfg.find_config_files(project='glance',
prog='glance-registry')
cfg_files.extend(cfg.find_config_files(project='glance',

View File

@ -81,6 +81,7 @@ cli_opts = [
CONF = cfg.CONF
CONF.register_cli_opts(cli_opts)
logging.register_options(CONF)
CONF.set_default(name='use_stderr', default=True, enforce_type=True)
# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...

View File

@ -43,6 +43,7 @@ eventlet.patcher.monkey_patch(all=False, socket=True, time=True, select=True,
CONF = cfg.CONF
logging.register_options(CONF)
CONF.set_default(name='use_stderr', default=True, enforce_type=True)
def main():

View File

@ -0,0 +1,14 @@
---
upgrade:
- A recent change to oslo.log (>= 3.17.0) set the default value
of ``[DEFAULT]/use_stderr`` to ``False`` in order to produce
duplication of logs (as reported in bug \#1588051). Since this
would change the current behaviour of certain glance commands
(e.g., glance-replicator, glance-cache-manage, etc.), we chose to
override the default value of ``use_stderr`` to ``True`` in those
commands. We also chose not to override that value in any Glance
service (e.g., glance-api, glance-registry) so that duplicate
logs are not created by those services. Operators that have a
usecase that relies on logs being reported on standard error may
set ``[DEFAULT]/use_stderr = True`` in the appropriate service's
configuration file upon deployment.