When invoked by a non-admin user it was returning only networks
assigned to the user's tenant. But in flat and flat DHCP nova
networking, networks CAN NOT be assigned to tenants --- thus a
non-admin user would get zero networks from this operation.
The fix was to make this operation conditionally use an option already
present in the lower-level code to "allow_none" when fetching the list
of networks, meaning to include networks whose project_id field in the
DB held "none" (meaning the network is not assigned to a tenant). The
condition under which this is done is that the Nova configuration
option named network_manager contains the string
"'nova.network.manager.Flat" --- which is true for flat and flat DHCP
nova networking and false for VLAN nova networking.
Reviewed: https:/ /review. openstack. org/101724 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=46e88320e6e 6231550f3e2b403 12c51f55e059f5
Committed: https:/
Submitter: Jenkins
Branch: master
commit 46e88320e6e6231 550f3e2b40312c5 1f55e059f5
Author: Mike Spreitzer <email address hidden>
Date: Sun Jun 22 02:09:17 2014 +0000
Made unassigned networks visible in flat networking
This change fixes a bug in Nova's id}/os- networks
GET /v2/{tenant_
The doc docs.openstack. org/api/ openstack- compute/ 2/content/ GET_os- networks- v2_ListNetworks __v2__tenant_ id__os- networks_ ext-os- networks. html
http://
says that "Lists networks that are available to the tenant".
When invoked by a non-admin user it was returning only networks
assigned to the user's tenant. But in flat and flat DHCP nova
networking, networks CAN NOT be assigned to tenants --- thus a
non-admin user would get zero networks from this operation.
The fix was to make this operation conditionally use an option already network. manager. Flat" --- which is true for flat and flat DHCP
present in the lower-level code to "allow_none" when fetching the list
of networks, meaning to include networks whose project_id field in the
DB held "none" (meaning the network is not assigned to a tenant). The
condition under which this is done is that the Nova configuration
option named network_manager contains the string
"'nova.
nova networking and false for VLAN nova networking.
Change-Id: I64c5a3f31c912c ca6b5b9987152ba 7a9b3f5987d
Closes-Bug: #1327406