From 502f40a7d24dd2603bc9e026edc685a956a52e15 Mon Sep 17 00:00:00 2001 From: Eric K Date: Sun, 5 Aug 2018 22:17:52 -0700 Subject: [PATCH] fix cfgvalidator_driver error missing id_ attrib oslo.config 4.4.0 adds some default options to each config object. These default options caused errors because they are not expected by the code in cfgvalidator_driver. This patch fixes the error by having cfgvalidator_driver code filter out unexpected options based on required attributes. Change-Id: I6b8839dcb0e53839206ec2bb42c8945dc867249a Release-team: bugfix --- congress/datasources/cfgvalidator_driver.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/congress/datasources/cfgvalidator_driver.py b/congress/datasources/cfgvalidator_driver.py index 909c6623e..ff120b578 100644 --- a/congress/datasources/cfgvalidator_driver.py +++ b/congress/datasources/cfgvalidator_driver.py @@ -478,6 +478,13 @@ class ValidatorDriver(datasource_driver.PollingDataSourceDriver): def _do_translation(option, group_name='DEFAULT'): option = option['opt'] + # skip options that do not have the required attributes + # avoids processing built-in options included by oslo.config, which + # don't have all the needed IdentifiedOpt attributes. + # see: https://github.com/openstack/oslo.config/commit/5ad89d40210bf5922de62e30b096634cac36da6c#diff-768b817a50237989cacd1a8064b4a8af # noqa + for attribute in ['id_', 'name', 'type', 'ns_id']: + if not hasattr(option, attribute): + return self.translate_option(option, group_name)