``get_ports`` query done in ``check_baremetal_ports_dhcp_options`` cannot filter by VNIC type

Bug #1979643 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Rodolfo Alonso

Bug Description

``get_ports`` method calls ``neutron_lib.db.model_query.get_collection_query``. The "filters" parameter passed on this call can only apply to the DB model required, in this case "ports". The VNIC type field is not in "port" but in "ml2_port_bindings", that is a child model of "ports".

In other to execute this query, a custom made query could be required.

This is related to patch https://review.opendev.org/c/openstack/neutron/+/840316.

Tags: ovn
Changed in neutron:
importance: Undecided → Medium
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/847346

Changed in neutron:
status: New → In Progress
tags: added: ovn
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/847346
Committed: https://opendev.org/openstack/neutron/commit/b497ad1665680cfff5173fbf08b06919e34c6776
Submitter: "Zuul (22348)"
Branch: master

commit b497ad1665680cfff5173fbf08b06919e34c6776
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sat Jun 18 16:06:05 2022 +0000

    Filter the ports by VNIC type

    In ``check_baremetal_ports_dhcp_options``, the ports need to be
    retrieved based on the VNIC type. The VNIC type is stored in
    "ml2_port_bindings" table, not "ports" table. Because the ML2Plugin
    ``get_ports`` method can filter only by "ports" database register
    fields, it is needed to retrieve those ports using a custom database
    query and then use the plugin method to retrieve the ports, converted
    to dictionaries and the extensions processed.

    Closes-Bug: #1979643
    Change-Id: Iab227d9de75e4b1b927043ce27bdc346066478e8

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

This issue was fixed in the openstack/neutron 21.0.0.0rc1 release candidate.

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.