api_extensions_path duplicates cause problems

Bug #1403958 reported by Ionut Hulub
6
This bug affects 1 person
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/neutron.conf.

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/neutron/server.log for the trace.

Changed in neutron:
assignee: nobody → Sridhar Gaddam (sridhargaddam)
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

IMO that is configuration problem and it doesn't make much sense to fix it.

Changed in neutron:
status: New → Opinion
Revision history for this message
Ionut Hulub (ionut-hulub) wrote :

I believe that at the very least a warning should be added to neutron.conf that extensions that call super() will fail if there are duplicates in the list.

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.