]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Be compatible with oslo.config 1.2.0a3+
authorDirk Mueller <dirk@dmllr.de>
Mon, 24 Jun 2013 18:56:32 +0000 (20:56 +0200)
committerDirk Mueller <dirk@dmllr.de>
Thu, 11 Jul 2013 10:05:41 +0000 (12:05 +0200)
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

neutron/plugins/cisco/common/config.py

index 6708de875745d78bb36842113b4ef84068966325..30e755164bed93b9b124d7a31db5c682024bb854 100644 (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]