Fix issue with missing url parameters

OSC uses these. project_id and tenant_id for neutron are interchangable.
If we list them in the QueryParameters list as project_id='tenant_id'
then a user can specify either. We'd done this for all of the *other*
Resources, but for some reason Network was left out.

ip_version is a valid query parameter for network_ip_availability, and
we even have it documented, but it's not in the list either.

We should have caught this before the last release - but actually only
just now got osc-functional-tips jobs turned back on. Sigh.

Change-Id: I1037dac37b15edbd2b8a17d7ed4ba639cf8e960b
This commit is contained in:
Monty Taylor 2018-02-02 17:23:39 -06:00
parent a65b18eab0
commit 8cdf409c3d
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
4 changed files with 11 additions and 3 deletions

View File

@ -30,13 +30,14 @@ class Network(resource.Resource, tag.TagMixin):
# NOTE: We don't support query on list or datetime fields yet
_query_mapping = resource.QueryParameters(
'description', 'name', 'project_id', 'status',
'description', 'name', 'status',
ipv4_address_scope_id='ipv4_address_scope',
ipv6_address_scope_id='ipv6_address_scope',
is_admin_state_up='admin_state_up',
is_port_security_enabled='port_security_enabled',
is_router_external='router:external',
is_shared='shared',
project_id='tenant_id',
provider_network_type='provider:network_type',
provider_physical_network='provider:physical_network',
provider_segmentation_id='provider:segmentation_id',

View File

@ -29,7 +29,7 @@ class NetworkIPAvailability(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'network_id', 'network_name',
'ip_version', 'network_id', 'network_name',
project_id='tenant_id'
)

View File

@ -100,7 +100,7 @@ class TestNetwork(testtools.TestCase):
'marker': 'marker',
'description': 'description',
'name': 'name',
'project_id': 'project_id',
'project_id': 'tenant_id',
'status': 'status',
'ipv4_address_scope_id': 'ipv4_address_scope',
'ipv6_address_scope_id': 'ipv6_address_scope',

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixed an issue where some valid query parameters were not listed causing
errors due to the new behavior of throwing errors when an invalid filter
condition is specified. Specifically, ``tenant_id`` as a filter for
Neutron networks and ``ip_version`` for Neutron netork IP availability.