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
This commit is contained in:
Dirk Mueller 2013-06-24 20:56:32 +02:00
parent 568e166b84
commit 137a9e1d17

View File

@ -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]