ML2 Nexus mech driver not loading per-switch config from .conf files in config-dir

Bug #1494911 reported by Timothy Swanson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-cisco
New
Undecided
Unassigned

Bug Description

In testing RHEL, neutron-server.service starts neutron-server with --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-server BUT "ml2_mech_cisco_nexus:" sections in the *.conf files are not loaded.

I see configuration in the generic [ml2] section updated when put into the same .conf file as the ml2_mech_cisco_nexus sections. So, this is looking like a plugin problem.

The detail is as follows...

The nexus plugin utilizes variable .ini section names to allow for containment of config for one or more nexus switches. The format of these section names is:

    [ml2_mech_cisco_nexus:<IP address of switch>]

To support this, the networking_cisco/plugins/ml2/drivers/cisco/nexus/config.py code does the following:

    def _create_ml2_mech_device_cisco_dictionary(self):
        """Create the ML2 device cisco dictionary.

        Read data from the ml2_conf_cisco.ini device supported sections.
        """
        multi_parser = cfg.MultiConfigParser()
        read_ok = multi_parser.read(cfg.CONF.config_file)

        if len(read_ok) != len(cfg.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():
                dev_id, sep, dev_ip = parsed_item.partition(':')
                if dev_id.lower() == 'ml2_mech_cisco_nexus':
                    for dev_key, value in parsed_file[parsed_item].items():
                        self.nexus_dict[dev_ip, dev_key] = value[0]

The cfg.CONF.config_file value is a list of files found in the neutron-server command-line's entries with --config-file. It does NOT contain the *.conf files found in the directories given via --config-dir. The cfg.CONF.config_dir value contains the list of directories.

NOTE: The oslo config opts parser goes through all the files found in both config_file and *.conf in config_dir. But does not update the cfg.CONF.config_files list with the files found.

Tags: nexus
Dipa (dthakkar)
tags: added: nexus
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.