From 3233de8f0d13ad9e0223da9f1cf895aa30a6177e Mon Sep 17 00:00:00 2001 From: Beth Elwell Date: Wed, 28 Feb 2018 15:52:06 +0000 Subject: [PATCH] Add same launch instance error handling as image to instance Previously, when launching an instance with an instance snapshot rather than with an image, the error handling was not as pleasant. I.e. the volume size was not automatically set to the minimum size and the error message would only appear after attempting to launch an instance. This is a small patch that addresses this and makes the user experience more friendly. Change-Id: Ib694f66c74e90ee2e15201673de953c08cf10122 Closes-bug: #1752360 --- .../workflow/launch-instance/source/source.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js index e69c5c3676..a111672c71 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js @@ -516,7 +516,8 @@ function checkVolumeForImage() { var source = selection[0]; - if (source && ctrl.currentBootSource === bootSourceTypes.IMAGE) { + if (source && ctrl.currentBootSource === bootSourceTypes.IMAGE || + source && ctrl.currentBootSource === bootSourceTypes.INSTANCE_SNAPSHOT ) { var imageGb = source.size * 1e-9; var imageDisk = source.min_disk; ctrl.minVolumeSize = Math.ceil(Math.max(imageGb, imageDisk));