← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1577648] Re: Many classes lack @six.add_metaclass decoration

 

Reviewed:  https://review.openstack.org/311930
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=972cdef50cd32837b8328466e4d821bb36535130
Submitter: Jenkins
Branch:    master

commit 972cdef50cd32837b8328466e4d821bb36535130
Author: John Perkins <john.d.perkins@xxxxxxxxx>
Date:   Mon May 2 22:52:51 2016 -0600

    Classes lack metaclass decoration
    
    Add decorations where required.
    
    There are roughly a dozen classes in Neutron that define abstract
    methods or properties but are not decorated with
    @six.add_metaclass(abc.ABCMeta). Without this decoration, children
    can be created without defining the required methods or properties.
    
    Decorating RBACColumns in db/rbac_db_models.py causes failures and will
    be reported separately.
    
    Decorating unit tests is of dubious benifit and should be addressed
    separately (if at all).
    
    There are also several more places where metaclassing isn't correct, to
    be taken care of in follow-on patches.
    
    For example, BaseScheduler is using the fact the None doesn't have a
    filter_agents() method, which gives developers confusing error messages
    when they incorrectly implement the interface, and they won't see any
    error until schedule() is called. As an aside, the docstring for this
    base class is also incorrect.
    
    Change-Id: I2b2cce37d9b0d40559a715a7d510a969b8ba9963
    Closes-Bug: #1577648


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  Many classes lack @six.add_metaclass decoration

Status in neutron:
  Fix Released

Bug description:
  There are roughly a dozen classes in Neutron that define abstract
  methods or properties but are not decorated with
  @six.add_metaclass(abc.ABCMeta). Without this decoration, children can
  be created without defining the required methods or properties.

  Decorating RBACColumns in db/rbac_db_models.py causes failures and
  will be reported separately.

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


References