Topology: Remove dispach by method name construction

Bug #1737339 reported by Dima Kuznetsov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DragonFlow
Fix Released
Undecided
Unassigned

Bug Description

Topology looks for port event handler by:
1. extracting type of the port
2. creating handler name '_{type}_{action}'
3. checking if method exists.

Since there are not that many options, its nicer to dispatch them directly.

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

Reviewed: https://review.openstack.org/519322
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=adadf17948c5a44433e58d22f7f770d233f89a96
Submitter: Zuul
Branch: master

commit adadf17948c5a44433e58d22f7f770d233f89a96
Author: Dima Kuznetsov <email address hidden>
Date: Mon Nov 13 10:05:04 2017 +0200

    Topology: move filtering to ovsdb monitor

    Topology app keeps a local ovs port cache because it does not want all
    port updates to take effect. In particular, events with missing data
    (ofport, type). Moving this logic to vswitch_impl because it makes a lot
    of sense to hold off those events even for apps that consume OvsPorts.

    Partial-Bug: #1737339
    Change-Id: I0bc8053d6fb3ed277028cf6bce9c6a0269e601af

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/519323
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=2de5a5f64ac18f46ba2cd0e93eaeb61bdaf0e473
Submitter: Zuul
Branch: master

commit 2de5a5f64ac18f46ba2cd0e93eaeb61bdaf0e473
Author: Dima Kuznetsov <email address hidden>
Date: Mon Nov 13 10:20:02 2017 +0200

    Topology: remove local cache of OVS ports

    A previous patch moves all OvsPort filtering to vswitch_impl. This makes
    all updates valid for topology. This patch removes the local cache in
    favor of using DbStore.

    Partial-Bug: #1737339
    Change-Id: I686ec4dc99eda643db85b2a4f706250e58155e89

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/519324
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=f593475a6a03a2e9a1b00710a1485cc0550f58cd
Submitter: Zuul
Branch: master

commit f593475a6a03a2e9a1b00710a1485cc0550f58cd
Author: Dima Kuznetsov <email address hidden>
Date: Mon Nov 13 09:03:31 2017 +0200

    Topology: dispatch ovs port events directly

    This changes discards dynamic handler retrieval in favor of direct
    method calls. Old code was doing something along the lines of:

     handler = getattr(self, '_{port_type}_{action}')
     if handler:
         # ....

    Since there aren't that much cases to cover, and the dynamic resolution
    makes it a bit hard to navigate around the code, this patch removes it
    in favor of direct approach.

    Closes-Bug: #1737339
    Change-Id: Icbe50c0c74bcfaa89903e18808c3beca616638f8

Changed in dragonflow:
status: New → Fix Released
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.