Non-api filters not working with admin instance tab
The issue was that the filtering opts like project_name, image_name,
flavor_name that are not supported by nova API (non-api filters) do
not work expectedly. These filters are mapped to their IDs [1], but
an instance list retrieved before resolving non-API filters is used [2].
This commit changes the logic to resolve non-API filters first and
then retrieve instances using the updated search_opts.
Note that the image list is handled a bit specially. If 'image_name'
is specified as a filter, we retrieve a corresponding image detail
first before fetching instances to resolve the image name into its ID.
Otherwise, we retrieve images only related to instances retrieved
and this happens after retrieving instances.
Reviewed: https:/ /review. opendev. org/754658 /git.openstack. org/cgit/ openstack/ horizon/ commit/ ?id=6b79cdcc1b9 2a968c967286cc2 67bac39803c85e
Committed: https:/
Submitter: Zuul
Branch: master
commit 6b79cdcc1b92a96 8c967286cc267ba c39803c85e
Author: vinay_m <email address hidden>
Date: Mon Sep 28 14:22:18 2020 +0530
Non-api filters not working with admin instance tab
The issue was that the filtering opts like project_name, image_name,
flavor_name that are not supported by nova API (non-api filters) do
not work expectedly. These filters are mapped to their IDs [1], but
an instance list retrieved before resolving non-API filters is used [2].
This commit changes the logic to resolve non-API filters first and
then retrieve instances using the updated search_opts.
Note that the image list is handled a bit specially. If 'image_name'
is specified as a filter, we retrieve a corresponding image detail
first before fetching instances to resolve the image name into its ID.
Otherwise, we retrieve images only related to instances retrieved
and this happens after retrieving instances.
[1] https:/ /opendev. org/openstack/ horizon/ src/commit/ f90c3cd50174af4 927737e29e2765c d2d7ca507f/ openstack_ dashboard/ dashboards/ admin/instances /views. py#L166 /opendev. org/openstack/ horizon/ src/commit/ f90c3cd50174af4 927737e29e2765c d2d7ca507f/ openstack_ dashboard/ dashboards/ admin/instances /views. py#L154
[2] https:/
Closes-Bug: #1888490 375c0d49da3f753 0cbb99e16fe
Co-Authored-By: Akihiro Motoki <email address hidden>
Change-Id: Id43adbd44778d3