launch-instance workflow crash if image_type is empty

Bug #1993579 reported by Victor Coutellier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Victor Coutellier

Bug Description

Launch instance workflow crash during the load of the images through glance if there is an image with an empty string as image_type.

Following this code : https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js#L678, the check "angular.isDefined(image.properties.image_type)" will return true if the image_type is an empty string, but the next line "return image.properties.image_type || ..." will return false, which can lead to access to undefined variable and raise a javascript error.

Impact is the impossibility to launch a VM from an image or a snapshot in case of an empty image_type in the image list.

Solution is to better handle and test this edge case.

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/horizon/+/861919

Changed in horizon:
status: New → In Progress
Changed in horizon:
assignee: nobody → Victor Coutellier (alistarle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/c/openstack/horizon/+/861919
Committed: https://opendev.org/openstack/horizon/commit/01afd1ba70c207932a6574c9ab13036d40abe3fe
Submitter: "Zuul (22348)"
Branch: master

commit 01afd1ba70c207932a6574c9ab13036d40abe3fe
Author: Victor Coutellier <email address hidden>
Date: Wed Oct 19 21:17:07 2022 +0200

    Handle empty image_type in launch-instance workflow

    Fix the getImageType function to handle edge case
    when image_type attribute is present but is an
    empty string.

    Closes-Bug: 1993579
    Change-Id: Ie08cf1010d64ff927515b4792e9b052a76b6344d

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

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

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.