diff -Nru horizon-9.1.2/debian/changelog horizon-9.1.2/debian/changelog --- horizon-9.1.2/debian/changelog 2017-12-14 10:48:25.000000000 -0500 +++ horizon-9.1.2/debian/changelog 2017-12-21 15:12:04.000000000 -0500 @@ -1,3 +1,12 @@ +horizon (2:9.1.2-0ubuntu4) xenial; urgency=medium + + * d/p/let-nova-to-pick-availability-zone.patch: + In the Angular Launch Instance, if there is more than one + availability zone default to the option for the Nova scheduler to pick. + This is regression from the legacy Launch Instance feature. + + -- Shane Peters (shaner) Thu, 21 Dec 2017 15:12:04 -0500 + horizon (2:9.1.2-0ubuntu3) xenial; urgency=medium [ Corey Bryant ] diff -Nru horizon-9.1.2/debian/patches/let-nova-to-pick-availability-zone.patch horizon-9.1.2/debian/patches/let-nova-to-pick-availability-zone.patch --- horizon-9.1.2/debian/patches/let-nova-to-pick-availability-zone.patch 1969-12-31 19:00:00.000000000 -0500 +++ horizon-9.1.2/debian/patches/let-nova-to-pick-availability-zone.patch 2017-12-21 15:06:18.000000000 -0500 @@ -0,0 +1,83 @@ +From 70807b5ccf50bc609f7c670f8edbb4eb171d3ede Mon Sep 17 00:00:00 2001 +From: Matt Borland +Date: Mon, 29 Aug 2016 09:54:56 -0600 +Subject: [PATCH] Let Nova to pick availability zone if more than 1 + +In the Angular Launch Instance, if there is more than one availability zone, +default to the option for the Nova scheduler to pick. This is a regression +from the legacy Launch Instance feature. + +Change-Id: Ib81447382bc9d43e33ce97f78c085d2a94ff2018 +Closes-Bug: 1613900 +(cherry picked from commit be6bcef45289ce1a934db478e5c9c7705890af18) +(cherry picked from commit 821ac9a923dd1250e44df2c4fddef773a27d6e3f) + +Conflicts: +openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/details/details.html +--- + .../project/workflow/launch-instance/details/details.html | 9 +++++++-- + .../launch-instance/launch-instance-model.service.js | 15 ++++++++++++--- + .../launch-instance/launch-instance-model.service.spec.js | 2 +- + 3 files changed, 20 insertions(+), 6 deletions(-) + +From: Matt Borland +Description: Let Nova to pick availability zone if more than 1 +Origin: upstream, https://review.openstack.org/#/c/426170/ +Bug-Ubuntu: https://bugs.launchpad.net/horizon/+bug/1613900 +--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/details/details.html ++++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/details/details.html +@@ -21,8 +21,13 @@ + +
+ +- + +
+--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js ++++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js +@@ -291,13 +291,22 @@ + return zone.zoneState && zone.zoneState.available; + }) + .map(function (zone) { +- return zone.zoneName; ++ return {label: zone.zoneName, value: zone.zoneName}; + }) + ); + +- if (model.availabilityZones.length > 0) { +- model.newInstanceSpec.availability_zone = model.availabilityZones[0]; ++ if (model.availabilityZones.length === 1) { ++ model.newInstanceSpec.availability_zone = model.availabilityZones[0].value; ++ } else if (model.availabilityZones.length > 1) { ++ // There are 2 or more; allow ability for nova scheduler to pick, ++ // and make that the default. ++ model.availabilityZones.unshift({ ++ label: gettext("Any Availability Zone"), ++ value: "" ++ }); ++ model.newInstanceSpec.availability_zone = model.availabilityZones[0].value; + } ++ + } + + // Flavors +--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js ++++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js +@@ -300,7 +300,7 @@ + + expect(model.images.length).toBe(2); + expect(model.imageSnapshots.length).toBe(2); +- expect(model.availabilityZones.length).toBe(2); ++ expect(model.availabilityZones.length).toBe(3); // 2 + 1 for 'nova pick' + expect(model.flavors.length).toBe(2); + expect(model.keypairs.length).toBe(2); + expect(model.securityGroups.length).toBe(2); diff -Nru horizon-9.1.2/debian/patches/series horizon-9.1.2/debian/patches/series --- horizon-9.1.2/debian/patches/series 2017-12-14 10:48:25.000000000 -0500 +++ horizon-9.1.2/debian/patches/series 2017-12-21 14:55:51.000000000 -0500 @@ -5,3 +5,4 @@ embedded-xstatic.patch add-juju-environment-download.patch fix_create_consistency_group_form_exception.patch +let-nova-to-pick-availability-zone.patch