Do not write passwords to verbose logs. bug 916167

Look for _key and _password in flag names

Change-Id: Ic0c43ad70db0b9f819219e8ca4966908e48b50c9
This commit is contained in:
Joe Gordon
2012-01-12 14:29:06 -08:00
parent 7bf4c1b210
commit 0169b0c1e6

View File

@@ -393,6 +393,12 @@ def wait():
logging.debug(_('Full set of FLAGS:'))
for flag in FLAGS:
flag_get = FLAGS.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)):
logging.debug('%(flag)s : FLAG SET ' % locals())
else:
logging.debug('%(flag)s : %(flag_get)s' % locals())
try:
_launcher.wait()