non-api bound filters in instance index page are broken

Bug #1718725 reported by Huan Xiong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Huan Xiong

Bug Description

The issue was observed on latest code and can be reproduced as below:

- go to Admin dashboard instance index page
- select "image name" filter
- input a valid image name value (note: there are instances created with this image)
- press filter button
- a new page is returned with all instance, instead of instances with that image name

The same issue exists for "project" and "flavor name" filter (all are non-api bound filters).

Project dashboard has same issue too.

For Admin dashboard, I think the issue is with these code:

        if 'project' in search_opts and \
                not swap_filter(tenants, search_opts, 'project', 'tenant_id'):
                self._more = False
                return instances
        elif 'image_name' in search_opts and \
                not swap_filter(images, search_opts, 'image_name', 'image'):
                self._more = False
                return instances
        elif "flavor_name" in search_opts and \
                not swap_filter(flavors, search_opts, 'flavor_name', 'flavor'):
                self._more = False
                return instances

From what I can tell, they effectively do nothing unless user input invalid filter values. That explains why these filter don't work when user input valid filter values.

For Project dashboard, I don't find code that process the above filters. Bug?

Revision history for this message
Huan Xiong (huan.xiong) wrote :

I believe the issue was introduced in rev df194c ("Make API calls in Instances view parallel").

Take admin dashboard instances index page for example, its workflow was as below before rev df194c:

- get tenant list
- get image list
- get flavor list
- convert 'project', 'image_name' and 'flavor_name' filters, using information got in above steps
- get server list, using modified search options

After rev df194c the workflow was changed to:

- get tenant list, image list, flavor list, and server list in parallel
- convert 'project', 'image_name' and 'flavor_name' filters, using information got in above steps

As you see, the second step is useless because getting server list is done in first step.

summary: - non-api bound filters in instance index page didn't work
+ non-api bound filters in instance index page are broken
Changed in horizon:
assignee: nobody → Huan Xiong (huan.xiong)
Revision history for this message
Huan Xiong (huan.xiong) wrote :

The similar issue in project dashboard was caused by rev df194c too. It seemed that the following code were removed by mistake:

 $ git diff f31343 df194c -- dashboards/project/instances/views.py
--[snipped]--
- if 'image_name' in search_opts and \
- not swap_filter(images, search_opts, 'image_name', 'image'):
- self._more = False
- return instances
- elif 'flavor_name' in search_opts and \
- not swap_filter(flavors, search_opts, 'flavor_name', 'flavor'):
                 self._more = False
- return instances

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/506716

Changed in horizon:
status: New → In Progress
Ying Zuo (yingzuo)
Changed in horizon:
importance: Undecided → High
milestone: none → queens-1
Ying Zuo (yingzuo)
tags: added: pike-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/506716
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=610798376191902c402890c24e39e4de2e240d2e
Submitter: Jenkins
Branch: master

commit 610798376191902c402890c24e39e4de2e240d2e
Author: Huan Xiong <email address hidden>
Date: Sat Sep 23 00:41:15 2017 +0800

    Fix non-API bound filters in project and admin instance panels

    Filters like "image_name", "flavor_name" and "project" in instance
    panels are keys not supported in Nova List-Servers API directly, so they
    should be converted to "image", "flavor" and "project_id", respectively,
    before Horizon calling Nova List-Servers API.

    That used to work, but was broken in commit
    df194c8b4c25c6128f03a98fd0e628ba14b743ff because the code change messed
    up the order. This commit fixes it by converting those filters first and
    then calling Nova API with modified filters.

    Change-Id: I504caaab2b6f256e7eb8c2605acaec39c004e80f
    Closes-Bug: #1718725

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/509288

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/pike)

Reviewed: https://review.openstack.org/509288
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=98f78ced9f560aef3ea96428e33e8d0a41907fb5
Submitter: Jenkins
Branch: stable/pike

commit 98f78ced9f560aef3ea96428e33e8d0a41907fb5
Author: Huan Xiong <email address hidden>
Date: Sat Sep 23 00:41:15 2017 +0800

    Fix non-API bound filters in project and admin instance panels

    Filters like "image_name", "flavor_name" and "project" in instance
    panels are keys not supported in Nova List-Servers API directly, so they
    should be converted to "image", "flavor" and "project_id", respectively,
    before Horizon calling Nova List-Servers API.

    That used to work, but was broken in commit
    df194c8b4c25c6128f03a98fd0e628ba14b743ff because the code change messed
    up the order. This commit fixes it by converting those filters first and
    then calling Nova API with modified filters.

    Change-Id: I504caaab2b6f256e7eb8c2605acaec39c004e80f
    Closes-Bug: #1718725
    (cherry picked from commit 610798376191902c402890c24e39e4de2e240d2e)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.0.0b1

This issue was fixed in the openstack/horizon 13.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 12.0.1

This issue was fixed in the openstack/horizon 12.0.1 release.

Akihiro Motoki (amotoki)
tags: removed: pike-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.