Browse Source

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 3d7909deb2)
(cherry picked from commit 1949b403e9)
(cherry picked from commit 19aeba1f63)
tags/4.0.2
Dustin Schoenbrun 1 year ago
parent
commit
4f5811de96

+ 1
- 11
manila/service.py View File

@@ -378,17 +378,7 @@ def serve(server, workers=None):
378 378
 
379 379
 
380 380
 def wait():
381
-    LOG.debug('Full set of CONF:')
382
-    for flag in CONF:
383
-        flag_get = CONF.get(flag, None)
384
-        # hide flag contents from log if contains a password
385
-        # should use secret flag when switch over to openstack-common
386
-        if ("_password" in flag or "_key" in flag or
387
-                (flag == "sql_connection" and "mysql:" in flag_get)):
388
-            LOG.debug('%(flag)s : FLAG SET ', {"flag": flag})
389
-        else:
390
-            LOG.debug('%(flag)s : %(flag_get)s',
391
-                      {"flag": flag, "flag_get": flag_get})
381
+    CONF.log_opt_values(LOG, log.DEBUG)
392 382
     try:
393 383
         _launcher.wait()
394 384
     except KeyboardInterrupt:

+ 5
- 0
releasenotes/notes/use-oslo-logging-for-config-options-388da64bb4ce45db.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+fixes:
3
+  - Use Oslo's logging features to securely output the configuration options
4
+    for Manila.
5
+

Loading…
Cancel
Save