Service plugin class' get_plugin_type should be a classmethod

Bug #1590117 reported by Brandon Logan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-midonet
Fix Released
Low
YAMAMOTO Takashi
neutron
Fix Released
Undecided
Brandon Logan
tap-as-a-service
Fix Released
Undecided
YAMAMOTO Takashi

Bug Description

There isn't any reason to have it as an instance method as its only returning a constant.

$ git grep 'def get_plugin_type('
neutron/extensions/metering.py: def get_plugin_type(self):
neutron/extensions/qos.py: def get_plugin_type(self):
neutron/extensions/segment.py: def get_plugin_type(self):
neutron/extensions/tag.py: def get_plugin_type(self):
neutron/services/auto_allocate/plugin.py: def get_plugin_type(self):
neutron/services/flavors/flavors_plugin.py: def get_plugin_type(self):
neutron/services/l3_router/l3_router_plugin.py: def get_plugin_type(self):
neutron/services/network_ip_availability/plugin.py: def get_plugin_type(self):
neutron/services/service_base.py: def get_plugin_type(self):
neutron/services/timestamp/timestamp_plugin.py: def get_plugin_type(self):
neutron/tests/functional/pecan_wsgi/utils.py: def get_plugin_type(self):
neutron/tests/unit/api/test_extensions.py: def get_plugin_type(self):
neutron/tests/unit/api/test_extensions.py: def get_plugin_type(self):
neutron/tests/unit/dummy_plugin.py: def get_plugin_type(self):
neutron/tests/unit/extensions/test_flavors.py: def get_plugin_type(self):
neutron/tests/unit/extensions/test_l3.py: def get_plugin_type(self):
neutron/tests/unit/extensions/test_router_availability_zone.py: def get_plugin_type(self):
neutron/tests/unit/extensions/test_segment.py: def get_plugin_type(self):

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/326716

Changed in neutron:
assignee: nobody → Brandon Logan (brandon-logan)
status: New → In Progress
description: updated
summary: - Segment Extension get_plugin method should be a classmethod
+ Service plugin base class's get_plugin_type should be a classmethod
summary: - Service plugin base class's get_plugin_type should be a classmethod
+ Service plugin class's get_plugin_type should be a classmethod
summary: - Service plugin class's get_plugin_type should be a classmethod
+ Service plugin class' get_plugin_type should be a classmethod
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit c40403eee0e4775f7ed089c91d4e2e075818a179
Author: Brandon Logan <email address hidden>
Date: Tue Jun 7 14:29:36 2016 -0500

    Make service plugins' get_plugin_type classmethods

    Any service plugin that implements the get_plugin_type method should
    make it a classmethod. It should not need to be instantiated to
    retrieve the simple constant it returns in every case.

    Change-Id: Ia3a1237a5e07169ebc9378b1cd4188085e20d71c
    Closes-Bug: #1590117

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :
Changed in networking-midonet:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
importance: Undecided → Low
milestone: none → 2.0.0
status: New → In Progress
Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :
Changed in tap-as-a-service:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
status: New → In Progress
Changed in networking-midonet:
milestone: 2.0.0 → 3.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tap-as-a-service (master)

Reviewed: https://review.openstack.org/328051
Committed: https://git.openstack.org/cgit/openstack/tap-as-a-service/commit/?id=4d94a59934d3a6422b1c3b754725b9e601a702d2
Submitter: Jenkins
Branch: master

commit 4d94a59934d3a6422b1c3b754725b9e601a702d2
Author: YAMAMOTO Takashi <email address hidden>
Date: Fri Jun 10 11:25:49 2016 +0900

    Make get_plugin_type classmethod

    Following the recent Neutron change. [1]

    [1] Ia3a1237a5e07169ebc9378b1cd4188085e20d71c

    Closes-Bug: #1590117
    Change-Id: Id9796ef3ab05dd81d0846ddb8cb3f161a4fed627

Changed in tap-as-a-service:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b2

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

tags: removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-midonet (master)

Reviewed: https://review.openstack.org/326867
Committed: https://git.openstack.org/cgit/openstack/networking-midonet/commit/?id=39e387c182a5d713e17be4b77349a4472e73e7d6
Submitter: Jenkins
Branch: master

commit 39e387c182a5d713e17be4b77349a4472e73e7d6
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Jun 8 16:08:47 2016 +0900

    Make get_plugin_type classmethod

    Following the recent Neutron change. [1]

    [1] Ia3a1237a5e07169ebc9378b1cd4188085e20d71c

    Closes-Bug: #1590117
    Change-Id: I81f46ef6d855166240581d0f2843bd519d45c4a5

Changed in networking-midonet:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-midonet 3.0.0

This issue was fixed in the openstack/networking-midonet 3.0.0 release.

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.