Convert instance method to staticmethod in linux bridge agent

Bug #1805356 reported by Yang Youseok
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Yang Youseok

Bug Description

There were many instance methods unnecessarily maintained in linuxbridge_neutron_agent. I found it makes L2 extensions hard to use those functionality(e.g. get_all_devices()), so if there is no strong reasons to use instance method, it's better to fix it.

Yang Youseok (ileixe)
description: updated
Changed in neutron:
assignee: nobody → Yang Youseok (ileixe)
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/620277

Changed in neutron:
status: New → In Progress
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Yang:

Please, can you provide an example of where "get_all_devices()" is hard to use?

Anyway, I think the patch submitted is valid.

Revision history for this message
Yang Youseok (ileixe) wrote :

@Alonso

Hello Alonso. Sorry for my inaccurate expression. I mean I have to instantiate LinuxBridgeManager class to use get_all_devices() function in extension.

Honestly, imho it's better to refactor those static functions though, making staticmethod is compromising for now.

Miguel Lavalle (minsel)
Changed in neutron:
importance: Undecided → Medium
importance: Medium → Low
Revision history for this message
Miguel Lavalle (minsel) wrote :

Can you clarify a little more. What is wrong with instantiating the driver? How are you planning to use those methods?

Changed in neutron:
status: In Progress → Incomplete
Revision history for this message
Yang Youseok (ileixe) wrote :

@Miguel

Hello, Miguel. This is gist for our L2 extension.

https://gist.github.com/Xeite/717f5823e3577f9ee612e63543a64e8d

In fact, I only use 'LinuxBridgeManager.get_all_devices()' for the changed code.

Now, I wonder it's not promoted to use LinuxBridgeManager functions in L2 extensions. Let me know if it is.

Thanks.

Revision history for this message
Yang Youseok (ileixe) wrote :
Revision history for this message
Miguel Lavalle (minsel) wrote :

Fair enough! Thanks for the follow up

Changed in neutron:
status: Incomplete → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/620277
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=aaf215b5a59a7e22961d1c155d86367e35e78f87
Submitter: Zuul
Branch: master

commit aaf215b5a59a7e22961d1c155d86367e35e78f87
Author: Yang Youseok <email address hidden>
Date: Tue Nov 27 18:39:26 2018 +0900

    Convert instance method to staticmethod in linuxbridge_neutron_agent

    Convert unnessary instance method to staticmethod so that any plugin
    API can use the methods.

    Closes-Bug: #1805356
    Change-Id: Ic568f470b813b85cfa46aa46308480e2579f779c

Changed in neutron:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.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.