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:
parent
58424dd616
commit
f8e3a5e587
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user