Repository: cloudstack
Updated Branches:
  refs/heads/master 3ac8f8d60 -> 417239e44


CLOUDSTACK-8047: UI > zone wizard > add primary storage step: 
(zone-wide-primary-storage) fix a bug that failed to get cluster's hypervisor 
value if previous step (e.g. add host step) has ever failed.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/417239e4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/417239e4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/417239e4

Branch: refs/heads/master
Commit: 417239e440213e705ba7f745378465497536b069
Parents: 3ac8f8d
Author: Jessica Wang <[email protected]>
Authored: Mon Dec 8 15:18:01 2014 -0800
Committer: Jessica Wang <[email protected]>
Committed: Mon Dec 8 15:19:32 2014 -0800

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/417239e4/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 9461081..32ffb9d 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -4480,8 +4480,16 @@
                     array1.push("&scope=" + 
todb(args.data.primaryStorage.scope));
 
                     //zone-wide-primary-storage is supported only for KVM and 
VMWare
-                    if (args.data.primaryStorage.scope == "zone") {
-                        array1.push("&hypervisor=" + 
todb(args.data.cluster.hypervisor)); //hypervisor type of the hosts in zone 
that will be attached to this storage pool. KVM, VMware supported as of now.
+                    if (args.data.primaryStorage.scope == "zone") { 
//hypervisor type of the hosts in zone that will be attached to this storage 
pool. KVM, VMware supported as of now.
+                        if(args.data.cluster.hypervisor != undefined) {        
+                           array1.push("&hypervisor=" + 
todb(args.data.cluster.hypervisor)); 
+                        } else if(args.data.returnedCluster.hypervisortype != 
undefined) {        
+                           array1.push("&hypervisor=" + 
todb(args.data.returnedCluster.hypervisortype)); 
+                        } else {
+                               cloudStack.dialog.notice({
+                               message: "Error: args.data.cluster.hypervisor 
is undefined. So is args.data.returnedCluster.hypervisortype 
(zone-wide-primary-storage)"
+                            });     
+                        }
                     }
 
                     var server = args.data.primaryStorage.server;

Reply via email to