From: Dirk Mueller Date: Mon, 24 Jun 2013 18:56:32 +0000 (+0200) Subject: Be compatible with oslo.config 1.2.0a3+ X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f8e3a5e5877f6099acaa9b8a734df5cb78f3b4ec;p=openstack-build%2Fneutron-build.git Be compatible with oslo.config 1.2.0a3+ The private API of oslo.config changed, and the Cisco options parsing code was using it. Use an explicit MultiConfigParser instance for parsing the config files. Fixes LP Bug #1196084 Change-Id: I7ffcac3c295491fe9ba8abc7e98f33157a48c51b --- diff --git a/neutron/plugins/cisco/common/config.py b/neutron/plugins/cisco/common/config.py index 6708de875..30e755164 100644 --- a/neutron/plugins/cisco/common/config.py +++ b/neutron/plugins/cisco/common/config.py @@ -93,10 +93,17 @@ class CiscoConfigOptions(): Reads data from cisco_plugins.ini NEXUS_SWITCH section(s). """ - for parsed_file in cfg.CONF._cparser.parsed: + + multi_parser = cfg.MultiConfigParser() + read_ok = multi_parser.read(CONF.config_file) + + if len(read_ok) != len(CONF.config_file): + raise cfg.Error("Some config files were not parsed properly") + + for parsed_file in multi_parser.parsed: for parsed_item in parsed_file.keys(): nexus_name, sep, nexus_ip = parsed_item.partition(':') - if nexus_name == 'NEXUS_SWITCH': + if nexus_name.lower() == "nexus_switch": for nexus_key, value in parsed_file[parsed_item].items(): nexus_dictionary[nexus_ip, nexus_key] = value[0]