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
This commit is contained in:
@@ -387,18 +387,7 @@ def serve(server, workers=None):
|
|||||||
|
|
||||||
|
|
||||||
def wait():
|
def wait():
|
||||||
LOG.debug('Full set of CONF:')
|
CONF.log_opt_values(LOG, log.DEBUG)
|
||||||
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 == "transport_url" and "rabbit:" in flag_get) 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})
|
|
||||||
try:
|
try:
|
||||||
_launcher.wait()
|
_launcher.wait()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Use Oslo's logging features to securely output the configuration options
|
||||||
|
for Manila.
|
||||||
|
|
||||||
Reference in New Issue
Block a user