Many classes lack @six.add_metaclass decoration

Bug #1577648 reported by John Perkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Unassigned

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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/311930

Changed in neutron:
assignee: nobody → John Perkins (john-d-perkins)
status: New → In Progress
Ryan Moats (rmoats)
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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 <email address hidden>
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
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b1

This issue was fixed in the openstack/neutron 9.0.0.0b1 development milestone.

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.