CS-17074: cloudstack UI - Advanced SG-enabled zone - Zone Wizard - When Advanced option is selected and Security Groups checkbox is checked, hypervisor dropdown will list only KVM option (if KVM is in listHypervisors API response).

This commit is contained in:
Jessica Wang 2012-12-12 14:30:12 -08:00
parent 41dd38c86b
commit c8926de018
1 changed files with 10 additions and 1 deletions

View File

@ -370,11 +370,20 @@
var array1 = [];
var firstOption = "XenServer";
if(args.context.zones[0]['network-model'] == "Advanced" && args.context.zones[0]['zone-advanced-sg-enabled'] == "on")
var nonSupportedHypervisors = {};
if(args.context.zones[0]['network-model'] == "Advanced" && args.context.zones[0]['zone-advanced-sg-enabled'] == "on") {
firstOption = "KVM";
nonSupportedHypervisors["XenServer"] = 1; //to developers: comment this line if you need to test Advanced SG-enabled zone with XenServer hypervisor
nonSupportedHypervisors["VMware"] = 1;
nonSupportedHypervisors["BareMetal"] = 1;
nonSupportedHypervisors["Ovm"] = 1;
}
if(items != null) {
for(var i = 0; i < items.length; i++) {
if(items[i].name in nonSupportedHypervisors)
continue;
if(items[i].name == firstOption)
array1.unshift({id: items[i].name, description: items[i].name});
else