get_agent_network_active_port_count call needs update

Bug #1730076 reported by Zhiyuan Cai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-sfc
Fix Released
Undecided
Bernard Cafarelli

Bug Description

In this neutron patch: (Change-Id: Idf72866d36f27ad0aa9b7a0b53034d2db45cd56d), the signature of get_agent_network_active_port_count is changed:

-def get_agent_network_active_port_count(session, agent_host,
+def get_agent_network_active_port_count(context, agent_host,

but in networking_sfc/services/sfc/drivers/ovs/driver.py, the old signature is still used:

        for next_hop in flow_rule['next_hops']:
            agent_active_ports = \
                l2pop_db.get_agent_network_active_port_count(
                    session,
                    pop_host,
                    next_hop['net_uuid'])

This causing the smoke test failure of tricircle project, here is the related log:

Nov 03 18:43:49.915582 ubuntu-xenial-ovh-bhs1-0000711316 neutron-server[18147]: ERROR networking_sfc.services.sfc.driver_manager File "/opt/stack/new/neutron/neutron/plugins/ml2/drivers/l2pop/db.py", line 152, in get_agent_network_active_port_count
Nov 03 18:43:49.915787 ubuntu-xenial-ovh-bhs1-0000711316 neutron-server[18147]: ERROR networking_sfc.services.sfc.driver_manager query = context.session.query(models_v2.Port)
Nov 03 18:43:49.915993 ubuntu-xenial-ovh-bhs1-0000711316 neutron-server[18147]: ERROR networking_sfc.services.sfc.driver_manager AttributeError: 'Session' object has no attribute 'session'

Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

Thanks, there is also get_agent_by_host method. This brings in some refactoring to pass the context along

Revision history for this message
Bernard Cafarelli (bcafarel) wrote :
Changed in networking-sfc:
assignee: nobody → Bernard Cafarelli (bcafarel)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-sfc (master)

Reviewed: https://review.openstack.org/518029
Committed: https://git.openstack.org/cgit/openstack/networking-sfc/commit/?id=7b578983c5399afb5bcb5be39e6cdf01ad470381
Submitter: Zuul
Branch: master

commit 7b578983c5399afb5bcb5be39e6cdf01ad470381
Author: Bernard Cafarelli <email address hidden>
Date: Mon Nov 6 17:28:59 2017 +0100

    Update l2pop calls to use context instead of session

    With the introduction of OVO objects, most l2pop methods were updated to
    use a context, and not a session:
    Idf72866d36f27ad0aa9b7a0b53034d2db45cd56d

    The OVS driver calls 2 of these methods, so update the related code to
    pass the context along

    Change-Id: I394f8a16a19bcd16d65a9fcfb985d6fb6217d093
    Closes-Bug: #1730076

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

This issue was fixed in the openstack/networking-sfc 6.0.0.0b2 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.