From 5259a13e4156f54ddd8c30c7d361921f33a2e589 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Fri, 29 Mar 2013 20:45:44 +0530 Subject: [PATCH] Zone wide primary storage is not supported for Xenserver as the Hypervisor but for KVM only --- ui/scripts/zoneWizard.js | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index c09da8a33a2..11db4db3d73 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -1185,16 +1185,32 @@ scope: { label: 'label.scope', select: function(args) { + + var selectedHypervisorObj = { + hypervisortype: $.isArray(args.context.zones[0].hypervisor) ? + // We want the cluster's hypervisor type + args.context.zones[0].hypervisor[1] : args.context.zones[0].hypervisor + }; - var scope = [ - { id: 'zone', description: _l('label.zone.wide') }, - { id: 'cluster', description: _l('label.cluster') }, - { id: 'host', description: _l('label.host') } - ]; + if(selectedHypervisorObj == null) { + return; + } - args.response.success({ - data: scope - }); + // ZWPS not supported for Xenserver + if(selectedHypervisorObj.hypervisortype == "XenServer"){ + var scope=[]; + scope.push({ id: 'cluster', description: _l('label.cluster') }); + scope.push({ id: 'host', description: _l('label.host') }); + args.response.success({data: scope}); + } + + else { + var scope=[]; + scope.push({ id: 'zone', description: _l('label.zone.wide') }); + scope.push({ id: 'cluster', description: _l('label.cluster') }); + scope.push({ id: 'host', description: _l('label.host') }); + args.response.success({data: scope}); + } }