wrong FilterAction instance is being created during filtering
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Undecided
|
Akihiro Motoki |
Bug Description
Suppose we have deployed Openstack with several projects.
Step to reproduce:
- open Horizon dashboard and log in as an administrator;
- go to Admin > Overview > Compute > Instances;
- type name of any project in filter bar and click "filter";
- in result table appear instances of project whose name doesn't match search string;
This behaviour can be clearly seen on the screenshot that I attach to the issue.
I've been discovering the reason of this and figured out that actually by clicking on "filter" button (even with "Project name =" selected in dropdown) eventually a method of `FilterAction` instance is being called instead of concrete one which would contain some logic in `filter()`.
Please look at: https:/
this is the one I've described beyond. Method just return the whole data. It is overridden in subclasses but as I mentioned it creates the base class (`FilterAction`) instead of correct one for some filter field chosen in dropdown.
description: | updated |
description: | updated |
Changed in horizon: | |
assignee: | nobody → vinay harsha mitta (vinay7) |
Changed in horizon: | |
assignee: | vinay harsha mitta (vinay7) → Akihiro Motoki (amotoki) |
The issue was with GET call for instances , i.e the filtering opts like project_name, image_name, flavor_name are not supported by nova_api (non-api filters), so these get mapped to their id's first and then updated in search_opts dict which is passed for retrieving instances. For the admin tab this call[1] was happening prior to non-api filters mapping[2] , so in-order to work a second call with updated search_opts dict should be called.
[1] .https:/ /opendev. org/openstack/ horizon/ src/branch/ master/ openstack_ dashboard/ dashboards/ admin/instances /views. py#L154
[2]. https:/ /opendev. org/openstack/ horizon/ src/branch/ master/ openstack_ dashboard/ dashboards/ admin/instances /views. py#L166