bug 13313: cloudstack 3.0 UI - Add Zone wizard - Skip addHost step when cluster dropdown is selected as VMWare in AddZone step.

This commit is contained in:
Jessica Wang 2012-03-28 13:30:14 -07:00
parent feb3659416
commit 98bd43520a
1 changed files with 25 additions and 38 deletions

View File

@ -223,8 +223,8 @@
}).length;
},
addHost: function(args) {
return (args.groupedData.cluster.hypervisor != "VMware");
addHost: function(args) {
return (args.groupedData.zone.hypervisor != "VMware");
},
addPrimaryStorage: function(args) {
@ -2400,7 +2400,7 @@
addCluster: function(args) {
message(dictionary['message.creating.cluster']);
// Have cluster use zone's hypervisor
args.data.cluster.hypervisor = args.data.zone.hypervisor ?
args.data.zone.hypervisor : args.data.cluster.hypervisor;
@ -2451,7 +2451,7 @@
})
});
}
else { //args.groupedData.cluster.hypervisor == "VMware", skip add host step
else {
stepFns.addPrimaryStorage({
data: $.extend(args.data, {
returnedCluster: json.addclusterresponse.cluster[0]
@ -2476,43 +2476,30 @@
array1.push("&hypervisor=" + todb(args.data.returnedCluster.hypervisortype));
var clustertype = args.data.returnedCluster.clustertype;
array1.push("&clustertype=" + todb(clustertype));
array1.push("&hosttags=" + todb(args.data.host.hosttags));
array1.push("&hosttags=" + todb(args.data.host.hosttags));
array1.push("&username=" + todb(args.data.host.username));
array1.push("&password=" + todb(args.data.host.password));
if(args.data.cluster.hypervisor == "VMware") {
array1.push("&username=");
array1.push("&password=");
var hostname = args.data.host.vcenterHost;
var url;
if(hostname.indexOf("http://")==-1)
url = "http://" + hostname;
else
url = hostname;
array1.push("&url=" + todb(url));
}
else {
array1.push("&username=" + todb(args.data.host.username));
array1.push("&password=" + todb(args.data.host.password));
var hostname = args.data.host.hostname;
var hostname = args.data.host.hostname;
var url;
if(hostname.indexOf("http://")==-1)
url = "http://" + hostname;
else
url = hostname;
array1.push("&url="+todb(url));
var url;
if(hostname.indexOf("http://")==-1)
url = "http://" + hostname;
else
url = hostname;
array1.push("&url="+todb(url));
if (args.data.cluster.hypervisor == "BareMetal") {
array1.push("&cpunumber=" + todb(args.data.host.baremetalCpuCores));
array1.push("&cpuspeed=" + todb(args.data.host.baremetalCpu));
array1.push("&memory=" + todb(args.data.host.baremetalMemory));
array1.push("&hostmac=" + todb(args.data.host.baremetalMAC));
}
else if(args.data.cluster.hypervisor == "Ovm") {
array1.push("&agentusername=" + todb(args.data.host.agentUsername));
array1.push("&agentpassword=" + todb(args.data.host.agentPassword));
}
}
if (args.data.cluster.hypervisor == "BareMetal") {
array1.push("&cpunumber=" + todb(args.data.host.baremetalCpuCores));
array1.push("&cpuspeed=" + todb(args.data.host.baremetalCpu));
array1.push("&memory=" + todb(args.data.host.baremetalMemory));
array1.push("&hostmac=" + todb(args.data.host.baremetalMAC));
}
else if(args.data.cluster.hypervisor == "Ovm") {
array1.push("&agentusername=" + todb(args.data.host.agentUsername));
array1.push("&agentpassword=" + todb(args.data.host.agentPassword));
}
$.ajax({
url: createURL("addHost" + array1.join("")),