Merge "Ignore KeyError for secret field"

This commit is contained in:
Jenkins 2015-09-08 15:06:03 +00:00 committed by Gerrit Code Review
commit f94d759499

View File

@ -137,9 +137,13 @@ class DataSourceManager(object):
for datasouce_driver in datasources_db.get_datasources():
result = cls.make_datasource_dict(datasouce_driver)
if filter_secret:
hide_fields = cls.get_driver_info(result['driver'])['secret']
for hide_field in hide_fields:
# secret field may be not provided while creating datasource
try:
hides = cls.get_driver_info(result['driver'])['secret']
for hide_field in hides:
result['config'][hide_field] = "<hidden>"
except KeyError:
pass
results.append(result)
return results