Updated Branches: refs/heads/master 86c0e28c0 -> 402cc917b
CLOUDSTACK-2782: UI - zone wizard - add cluster step - remove obsolete code. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/402cc917 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/402cc917 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/402cc917 Branch: refs/heads/master Commit: 402cc917b901a58c395de06ed33ef0e14c6bf1d5 Parents: 86c0e28 Author: Jessica Wang <jessicaw...@apache.org> Authored: Tue Jun 4 16:20:34 2013 -0700 Committer: Jessica Wang <jessicaw...@apache.org> Committed: Tue Jun 4 16:20:34 2013 -0700 ---------------------------------------------------------------------- ui/scripts/zoneWizard.js | 95 ++++++++++++++++------------------------ 1 files changed, 38 insertions(+), 57 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/402cc917/ui/scripts/zoneWizard.js ---------------------------------------------------------------------- diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index a7791bb..07558e3 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -3361,75 +3361,56 @@ } array1.push("&clustername=" + todb(clusterName)); - if(args.data.cluster.hypervisor == "VMware"){ - - var vmwareData = { - - zoneId: args.data.returnedZone.id, - username: args.data.cluster.vCenterUsername, - password: args.data.cluster.vCenterPassword, - name: args.data.cluster.vCenterDatacenter - - }; - - $.ajax({ - url: createURL('addVmwareDc&url=' + todb(url)), - data: vmwareData, - success: function(json) { - var item = json.addvmwaredcresponse.vmwaredc; - if(item.id != null){ - $.ajax({ - url: createURL("addCluster" + array1.join("")), - dataType: "json", - async: true, - success: function(json) { - stepFns.addPrimaryStorage({ - data: $.extend(args.data, { - returnedCluster: json.addclusterresponse.cluster[0] - }) - }); - - }, - error: function(XMLHttpResponse) { - var errorMsg = parseXMLHttpResponse(XMLHttpResponse); - error('addCluster', errorMsg, { fn: 'addCluster', args: args }); - } - }); - } - - } - }); - - } - + if(args.data.cluster.hypervisor == "VMware"){ + var vmwareData = { + zoneId: args.data.returnedZone.id, + username: args.data.cluster.vCenterUsername, + password: args.data.cluster.vCenterPassword, + name: args.data.cluster.vCenterDatacenter + }; + $.ajax({ + url: createURL('addVmwareDc&url=' + todb(url)), + data: vmwareData, + success: function(json) { + var item = json.addvmwaredcresponse.vmwaredc; + if(item.id != null){ + $.ajax({ + url: createURL("addCluster" + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + stepFns.addPrimaryStorage({ //skip "add host step" when hypervisor is VMware + data: $.extend(args.data, { + returnedCluster: json.addclusterresponse.cluster[0] + }) + }); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + error('addCluster', errorMsg, { fn: 'addCluster', args: args }); + } + }); + } + } + }); + } else{ - $.ajax({ url: createURL("addCluster" + array1.join("")), dataType: "json", async: true, success: function(json) { - if(args.data.cluster.hypervisor != "VMware") { - stepFns.addHost({ - data: $.extend(args.data, { - returnedCluster: json.addclusterresponse.cluster[0] - }) - }); - } - else { - stepFns.addPrimaryStorage({ - data: $.extend(args.data, { - returnedCluster: json.addclusterresponse.cluster[0] - }) - }); - } + stepFns.addHost({ + data: $.extend(args.data, { + returnedCluster: json.addclusterresponse.cluster[0] + }) + }); }, error: function(XMLHttpResponse) { var errorMsg = parseXMLHttpResponse(XMLHttpResponse); error('addCluster', errorMsg, { fn: 'addCluster', args: args }); } }); - } },