image_list_detailed is called twice when launching an instance

Bug #1229080 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Akihiro Motoki

Bug Description

When showing a form of launching an instance, image_list_detailed is called twice.

populate_image_id_choices and populate_instance_snapshot_id_choices both call get_available_images().
https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py#L277

get_available_images() supports the cache of image list, but only populate_instance_snapshot_id_choices uses the cache.
It is better both methods share the cache.

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/47796

Changed in horizon:
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → havana-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/47796
Committed: http://github.com/openstack/horizon/commit/5dedb5d5834d23771b4e378269c434d0c7f91273
Submitter: Jenkins
Branch: master

commit 5dedb5d5834d23771b4e378269c434d0c7f91273
Author: Akihiro MOTOKI <email address hidden>
Date: Mon Sep 16 05:40:24 2013 +0900

    Reduce image_list_detailed calls

    When showing a form of launching an instance, image_list_detailed is called twice.
    populate_image_id_choices and populate_instance_snapshot_id_choices both call
    get_available_images(). get_available_images() supports the cache of image list
    and it is better to share the cache by both methods.

    Closes-Bug: #1229080

    Fixes a bug that utils.get_available_images() raises a traceback
    when image_list for a project raises an exception.

    Closes-Bug: #1229083

    Add unittests for images_and_snapshots.utils to cover the above two fixes.

    Change-Id: I829a430c84e48de4faf028bdfad74b0cd8f22dc9

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-rc1 → 2013.2
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.