Nexus_Switch config parsing incompatible with newer oslo.config versions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| neutron |
High
|
Dirk Mueller | ||
| Grizzly |
High
|
Unassigned | ||
| oslo-incubator |
Undecided
|
Unassigned |
Bug Description
quantum/
for parsed_file in cfg.CONF.
for parsed_item in parsed_file.keys():
if nexus_name == 'NEXUS_SWITCH':
Recently, _cparser has been renamed/removed as the implementation in oslo.config was changed by Mark. since then this code fails.
Is there a public API for iterating over all found groups in configs? I was only able to find a way to iterate over pre-registered config groups, which does not work here (as the code does not know the exact config group name yet. The code is designed to look for all groups in the form of [NEXUS_
Changed in neutron: | |
status: | New → Incomplete |
Mark McLoughlin (markmc) wrote : | #2 |
I think it's pretty clear Quantum should never have used this internal API, so marking as Invalid in oslo
Changed in oslo: | |
status: | New → Invalid |
Mark McLoughlin (markmc) wrote : | #3 |
Look at the way register_
Basically, the only reason you want to parse these files directly is to get the list of [NEXUS_SWITCH:<ip>] sections
Once you've got the list of IPs, you can do e.g.
nexus_opts = [
cfg.
...
]
def _read_nexus_
group_name = 'nexus_switch:' + ip
for key, value in conf[group_
def _read_nexus_
multi_parser = cfg.MultiConfig
read_ok = multi_parser.
if len(read_ok) != len(conf.
raise cfg.Error("Some config files were not parsed properly")
nexus_dict = {}
for parsed_file in multi_parser.
for section in parsed_file.keys():
if not section.
ip = section.split(':', 1)[1]
Dirk Mueller (dmllr) wrote : | #4 |
Thanks for the explanation! I'll work on it.
Changed in neutron: | |
assignee: | nobody → Dirk Mueller (dmllr) |
status: | New → In Progress |
Kyle Mestery (mestery) wrote : | #5 |
Dirk and Mark, thanks for triaging this and finding the bug in the Nexus plugin here. If there's anything else you guys need from us on the Cisco side, let me know. We can test out your fix with actual Nexus hardware if you want, for example.
Dirk Mueller (dmllr) wrote : | #6 |
That would be great. I'll ping you once the review is online in gerrit.
tags: | added: cisco |
Changed in neutron: | |
status: | In Progress → Triaged |
importance: | Undecided → Medium |
Mark McLoughlin (markmc) wrote : | #7 |
Dirk - any update? We really could do with this backported to stable/grizzly
Changed in neutron: | |
importance: | Medium → High |
Kyle Mestery (mestery) wrote : | #8 |
Dirk, if you are swamped, we at Cisco are happy to take this over and fix it. Please let us know ASAP.
Dirk Mueller (dmllr) wrote : | #9 |
I was literally just working on it when I got interrupted by debugging another issue. I'll post a patch by tomorrow morning.
Changed in neutron: | |
status: | Triaged → In Progress |
Dirk Mueller (dmllr) wrote : | #10 |
This changeset seems to work for me (tested with a small test wrapper):
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: master
commit f8e3a5e5877f609
Author: Dirk Mueller <email address hidden>
Date: Mon Jun 24 20:56:32 2013 +0200
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: I7ffcac3c295491
Changed in neutron: | |
status: | In Progress → Fix Committed |
Dirk Mueller (dmllr) wrote : | #12 |
This code doesn't exist in grizzly, so marking as invalid there. there is however similar code in the Nicira plugin. I'll file a separate bugreport for this.
Changed in neutron: | |
milestone: | none → havana-2 |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | havana-2 → 2013.2 |
This was caused by commit f083d7cfcbc2227 20fd479a1dabe08 d7ae7ed044:
Author: Mark McLoughlin <email address hidden>
Date: Fri May 17 00:31:22 2013 +0100
Parse config files in an argparse callback
Part of fixing bug #1176817
where self._cparser was renamed to self._namespace:
- self._cparser = None
self. _cli_values = {}
+ self._namespace = None
Mark, could you explain why the bug was marked as incomplete?