You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/06/05 01:25:13 UTC

git commit: updated refs/heads/master to 402cc91

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 <je...@apache.org>
Authored: Tue Jun 4 16:20:34 2013 -0700
Committer: Jessica Wang <je...@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 });
             }
           });
-
          }
         },