summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-27 19:48:40 +0000
committerGerrit Code Review <review@openstack.org>2016-09-27 19:48:40 +0000
commit74c83bdcaee4b669ac7e1cd877f62910c17363c2 (patch)
tree7bb69534288c63e93260f4652cefcfb2f58a124e
parentbd3df18398558104bd469c4bf615df33a15eebcd (diff)
parent58698541faaaee23f333ef45939fe10fe5687501 (diff)
Merge "Fix Launch Instance without Cinder" into stable/newton10.0.0.0rc2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js2
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js6
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js14
4 files changed, 19 insertions, 5 deletions
diff --git 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
index 50f81ac..0dc96d0 100644
--- 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
@@ -182,7 +182,7 @@
182 source_type: null, 182 source_type: null,
183 source: [], 183 source: [],
184 // REQUIRED for JS logic 184 // REQUIRED for JS logic
185 vol_create: true, 185 vol_create: false,
186 // May be null 186 // May be null
187 vol_device_name: 'vda', 187 vol_device_name: 'vda',
188 vol_delete_on_instance_delete: false, 188 vol_delete_on_instance_delete: false,
diff --git 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
index 9e8f6c3..70d686d 100644
--- 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
@@ -814,7 +814,7 @@
814 }); 814 });
815 815
816 it('sets volume options appropriately', function() { 816 it('sets volume options appropriately', function() {
817 expect(model.newInstanceSpec.vol_create).toBe(true); 817 expect(model.newInstanceSpec.vol_create).toBe(false);
818 expect(model.newInstanceSpec.vol_device_name).toBe('vda'); 818 expect(model.newInstanceSpec.vol_device_name).toBe('vda');
819 expect(model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false); 819 expect(model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
820 expect(model.newInstanceSpec.vol_size).toBe(1); 820 expect(model.newInstanceSpec.vol_size).toBe(1);
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 6e28352..6a18e24 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
@@ -401,7 +401,11 @@
401 401
402 function updateBootSourceSelection(selectedSource) { 402 function updateBootSourceSelection(selectedSource) {
403 ctrl.currentBootSource = selectedSource; 403 ctrl.currentBootSource = selectedSource;
404 $scope.model.newInstanceSpec.vol_create = true; 404 if ((selectedSource === bootSourceTypes.IMAGE) && $scope.model.volumeBootable) {
405 $scope.model.newInstanceSpec.vol_create = true;
406 } else {
407 $scope.model.newInstanceSpec.vol_create = false;
408 }
405 $scope.model.newInstanceSpec.vol_delete_on_instance_delete = false; 409 $scope.model.newInstanceSpec.vol_delete_on_instance_delete = false;
406 changeBootSource(selectedSource); 410 changeBootSource(selectedSource);
407 validateBootSourceType(); 411 validateBootSourceType();
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
index cbef3b0..70f6b57 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js
@@ -229,12 +229,12 @@
229 var tableKeys = ['available', 'allocated', 229 var tableKeys = ['available', 'allocated',
230 'displayedAvailable', 'displayedAllocated']; 230 'displayedAvailable', 'displayedAllocated'];
231 231
232 it('updates the scope appropriately', function() { 232 it('updates the scope appropriately, without Cinder available', function() {
233 var selSource = 'image'; 233 var selSource = 'image';
234 ctrl.updateBootSourceSelection(selSource); 234 ctrl.updateBootSourceSelection(selSource);
235 235
236 expect(ctrl.currentBootSource).toEqual('image'); 236 expect(ctrl.currentBootSource).toEqual('image');
237 expect(scope.model.newInstanceSpec.vol_create).toBe(true); 237 expect(scope.model.newInstanceSpec.vol_create).toBe(false);
238 expect(scope.model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false); 238 expect(scope.model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
239 239
240 // check table data 240 // check table data
@@ -244,6 +244,16 @@
244 expect(ctrl.tableBodyCells.length).toBeGreaterThan(0); 244 expect(ctrl.tableBodyCells.length).toBeGreaterThan(0);
245 }); 245 });
246 246
247 it('updates the scope appropriately, with Cinder available', function() {
248 scope.model.volumeBootable = true;
249 var selSource = 'image';
250 ctrl.updateBootSourceSelection(selSource);
251
252 expect(ctrl.currentBootSource).toEqual('image');
253 expect(scope.model.newInstanceSpec.vol_create).toBe(true);
254 expect(scope.model.newInstanceSpec.vol_delete_on_instance_delete).toBe(false);
255 });
256
247 it('should broadcast event when boot source changes', function() { 257 it('should broadcast event when boot source changes', function() {
248 spyOn(scope, '$broadcast'); 258 spyOn(scope, '$broadcast');
249 scope.$apply(); 259 scope.$apply();