From b7de0333b13f73f6a66380623d7579373709c756 Mon Sep 17 00:00:00 2001 From: Travis Tripp Date: Tue, 14 Apr 2015 05:05:28 -0600 Subject: [PATCH] [Launch Instance Fix] Security Group Nova Net When nova networking is enabled, the input to security groups needs to be by name. When neutron, it needs to be by id. This solves that issues. Change-Id: If32671af90facd16e60caa33ed84ba7c9796ad11 Closes-Bug: #1445235 --- .../dashboard/launch-instance/launch-instance.model.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/static/dashboard/launch-instance/launch-instance.model.js b/openstack_dashboard/static/dashboard/launch-instance/launch-instance.model.js index 912673101f..5b707e00f2 100644 --- a/openstack_dashboard/static/dashboard/launch-instance/launch-instance.model.js +++ b/openstack_dashboard/static/dashboard/launch-instance/launch-instance.model.js @@ -109,6 +109,7 @@ volume: null }, networks: [], + neutronEnabled: false, novaLimits: {}, profiles: [], securityGroups: [], @@ -319,7 +320,11 @@ // pull out the ids from the security groups objects var security_group_ids = []; finalSpec.security_groups.forEach(function(securityGroup){ - security_group_ids.push(securityGroup.id); + if(model.neutronEnabled) { + security_group_ids.push(securityGroup.id); + } else { + security_group_ids.push(securityGroup.name); + } }); finalSpec.security_groups = security_group_ids; } @@ -331,6 +336,7 @@ } function onGetNetworks(data) { + model.neutronEnabled = true; model.networks.length = 0; push.apply(model.networks, data.data.items); }