api_extensions_path duplicates cause problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Opinion
|
Undecided
|
Sridhar Gaddam |
Bug Description
When creating api extensions for neutron you need to add the path to the extensions to the api_extensions_path param in /etc/neutron/
The __path__ of neutron.extensions is appended to that, so if one user if not careful and adds the __path__ of neutron.extensions to the list himself, all the extensions in that path will be imported twice.
When some extensions are loaded twice errors will occur. For example, when the L3 extension is loaded twice, super(L3, self) will crash with the following error: TypeError: super(type, obj): obj must be an instance or subtype of type. That happens because id(L3) changes when the 'l3.py' file is imported the second time and super checks if isinstance(self, L3), which will return False.
To reproduce this bug set api_extensions_path to the __path__ of neutron.extensions and restart neutron-server. Check /var/log/
Changed in neutron: | |
assignee: | nobody → Sridhar Gaddam (sridhargaddam) |
IMO that is configuration problem and it doesn't make much sense to fix it.