← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1308489] [NEW] Wrong issubclass() hook behavior in PluginInterface

 

Public bug reported:

Currently, PluginInterface provides an issubclass() hook that returns True for issubclass(A, B) call, if all abstract methods of A (stored in A.__abstractmethods__) can be found in the B.__mro__ tuple of classes. But there is an edge case, when A doesn't  have any abstract methods, which leads to issubclass(A, B) call returning True even if A and B are not related all.
    
E.g. issubclass(NeutronPluginPLUMgridV2, NsxPlugin) returns True, while these two are different core plugins. And it gets even more trickier when superclasses are involved: e.g. SecurityGroupDbMixin is a superclass of NsxPlugin, so depending on the fact whether the python module with NsxPlugin class is imported or not, issubclass(NeutronPluginPLUMgridV2, SecurityGroupDbMixin) will return either False or True accordingly.

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1308489

Title:
  Wrong issubclass() hook behavior in PluginInterface

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  Currently, PluginInterface provides an issubclass() hook that returns True for issubclass(A, B) call, if all abstract methods of A (stored in A.__abstractmethods__) can be found in the B.__mro__ tuple of classes. But there is an edge case, when A doesn't  have any abstract methods, which leads to issubclass(A, B) call returning True even if A and B are not related all.
      
  E.g. issubclass(NeutronPluginPLUMgridV2, NsxPlugin) returns True, while these two are different core plugins. And it gets even more trickier when superclasses are involved: e.g. SecurityGroupDbMixin is a superclass of NsxPlugin, so depending on the fact whether the python module with NsxPlugin class is imported or not, issubclass(NeutronPluginPLUMgridV2, SecurityGroupDbMixin) will return either False or True accordingly.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1308489/+subscriptions


Follow ups

References