← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1590117] Re: Service plugin class' get_plugin_type should be a classmethod

 

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 <brandon.logan@xxxxxxxxxxxxx>
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

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

Title:
  Service plugin class' get_plugin_type should be a classmethod

Status in networking-midonet:
  New
Status in neutron:
  Fix Released

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):

To manage notifications about this bug go to:
https://bugs.launchpad.net/networking-midonet/+bug/1590117/+subscriptions


References