Skip to content

Commit

Permalink
Be compatible with oslo.config 1.2.0a3+
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dirkmueller committed Jul 11, 2013
1 parent 58424dd commit f8e3a5e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions neutron/plugins/cisco/common/config.py
Expand Up @@ -93,10 +93,17 @@ def _create_nexus_dictionary(self):
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]

Expand Down

0 comments on commit f8e3a5e

Please sign in to comment.