Bug 2232573

Summary: Shared networks can be returned as "shared=False" in the API request
Product: Red Hat OpenStack Reporter: Slawek Kaplonski <skaplons>
Component: openstack-neutronAssignee: Rodolfo Alonso <ralonsoh>
Status: NEW --- QA Contact: Eran Kuris <ekuris>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16.2 (Train)CC: chrisw, ralonsoh, scohen
Target Milestone: z6Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Slawek Kaplonski 2023-08-17 12:33:00 UTC
This issue is caused by https://github.com/openstack/neutron-lib/commit/829e97024c2b73dd67bfd8a04c65f03be556eec8 which added "group by" clause to the sql query to get e.g. all networks.
If network is "access_as_external" and also "access_as_shared" then if regular user will do API request like:

GET /v2.0/networks?shared=True

It will receive that external AND shared network but it will have "shared=False" in the network parameters.

This is also causing failures in our CI jobs, like: https://rhos-ci-jenkins.lab.eng.tlv2.redhat.com/job/DFG-network-networking-ovn-16.2_director-rhel-virthost-3cont_2comp-ipv4-vxlan-ovn/24//artifact/tempest-results/tempest-results-neutron.1.html - see test neutron_tempest_plugin.api.admin.test_shared_network_extension.SharedNetworksTest.test_filtering_shared_networks