From 4f5811de9684d2b868d5969eaba983a12679ab81 Mon Sep 17 00:00:00 2001 From: Dustin Schoenbrun Date: Wed, 21 Feb 2018 17:02:31 -0500 Subject: [PATCH] Log config options with oslo.config This removes some custom code inherited from Cinder which was handling the output of secret options in a bad way. This patch utilizes Oslo's existing utilities to output the Manila configuration options securely. Filtering will be done with the "secret=True" option flag. Major thanks to Eric Harney for introducing this fix to Cinder. Change-Id: I894e011680661c0b73b9592f70a6457e403f18c6 Related-Bug: #1750074 (cherry picked from commit 3d7909deb21a1f0be4cd6eca13dc9e8d070f71e2) (cherry picked from commit 1949b403e9feb134d0fb2b9d65271292277351ee) (cherry picked from commit 19aeba1f63f4e864eebda61bf16a078055c79cb0) --- manila/service.py | 12 +----------- ...-logging-for-config-options-388da64bb4ce45db.yaml | 5 +++++ 2 files changed, 6 insertions(+), 11 deletions(-) create mode 100644 releasenotes/notes/use-oslo-logging-for-config-options-388da64bb4ce45db.yaml diff --git a/manila/service.py b/manila/service.py index a61f3e54c5..781294c4cf 100644 --- a/manila/service.py +++ b/manila/service.py @@ -378,17 +378,7 @@ def serve(server, workers=None): def wait(): - LOG.debug('Full set of CONF:') - for flag in CONF: - flag_get = CONF.get(flag, None) - # hide flag contents from log if contains a password - # should use secret flag when switch over to openstack-common - if ("_password" in flag or "_key" in flag or - (flag == "sql_connection" and "mysql:" in flag_get)): - LOG.debug('%(flag)s : FLAG SET ', {"flag": flag}) - else: - LOG.debug('%(flag)s : %(flag_get)s', - {"flag": flag, "flag_get": flag_get}) + CONF.log_opt_values(LOG, log.DEBUG) try: _launcher.wait() except KeyboardInterrupt: diff --git a/releasenotes/notes/use-oslo-logging-for-config-options-388da64bb4ce45db.yaml b/releasenotes/notes/use-oslo-logging-for-config-options-388da64bb4ce45db.yaml new file mode 100644 index 0000000000..2a6b107853 --- /dev/null +++ b/releasenotes/notes/use-oslo-logging-for-config-options-388da64bb4ce45db.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Use Oslo's logging features to securely output the configuration options + for Manila. +