Bug 2012910
Summary: | Server list by tags not working | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Matthew Booth <mbooth> |
Component: | python-openstackclient | Assignee: | Stephen Finucane <stephenfin> |
Status: | CLOSED MIGRATED | QA Contact: | nlevinki <nlevinki> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | unspecified | CC: | alifshit, apevec, dasmith, eglynn, jhakimra, jpichon, kchamart, lhh, mwitt, sbauza, sgordon, vromanso |
Target Milestone: | Upstream M1 | Keywords: | Triaged |
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: | 2024-01-10 20:27:31 UTC | 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
Matthew Booth
2021-10-11 15:08:23 UTC
(In reply to Matthew Booth from comment #0) > $ openstack --os-compute-api-version 2.26 server list --tags capo-e2e > Invalid input for query parameters tags. Value: ['capo-e2e']. "['capo-e2e']" > is not a 'regex' (HTTP 400) (Request-ID: > req-91a4d02a-8e4a-44c7-aa04-99808648a847) Looking at this error message ^ again, I think I see what the bug is in nova. The value of the query parameter is a list and the schema validation is expecting a 'regex' [1], not a list of regexes (which I think it should be). Based on another example in the same file, I think we might be able to fix this by adding the "multi_params" helper [2] around the 'regex' schema format. For example: query_params_v226 = copy.deepcopy(query_params_v21) query_params_v226['properties'].update({ 'tags': multi_params(parameter_types.common_query_regex_param), 'tags-any': multi_params(parameter_types.common_query_regex_param), 'not-tags': multi_params(parameter_types.common_query_regex_param), 'not-tags-any': multi_params(parameter_types.common_query_regex_param), }) [1] https://github.com/openstack/nova/blob/fdfdba265833d237e22676f9a223ab8ca0fe1e03/nova/api/openstack/compute/schemas/servers.py#L650-L653 [2] https://github.com/openstack/nova/blob/fdfdba265833d237e22676f9a223ab8ca0fe1e03/nova/api/validation/parameter_types.py#L57 (In reply to melanie witt from comment #1) > Based on another example in the same file, I think we might be able to fix > this by adding the "multi_params" helper [2] around the 'regex' schema > format. For example: > > query_params_v226 = copy.deepcopy(query_params_v21) > query_params_v226['properties'].update({ > 'tags': multi_params(parameter_types.common_query_regex_param), > 'tags-any': multi_params(parameter_types.common_query_regex_param), > 'not-tags': multi_params(parameter_types.common_query_regex_param), > 'not-tags-any': multi_params(parameter_types.common_query_regex_param), > }) Nevermind, I'm wrong, multi_params is already part of parameter_types.common_query_regex_param [3]. So, there is something else going wrong here. [3] https://github.com/openstack/nova/blob/fdfdba265833d237e22676f9a223ab8ca0fe1e03/nova/api/validation/parameter_types.py#L70 > [1] > https://github.com/openstack/nova/blob/ > fdfdba265833d237e22676f9a223ab8ca0fe1e03/nova/api/openstack/compute/schemas/ > servers.py#L650-L653 > [2] > https://github.com/openstack/nova/blob/ > fdfdba265833d237e22676f9a223ab8ca0fe1e03/nova/api/validation/parameter_types. > py#L57 |