CP-10334: Make Export resource data option available for pools or standalone hosts (used to be pool only)

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2014-11-17 11:43:35 +00:00
parent ee4d9da505
commit fcbefc6f75

View File

@ -36,6 +36,7 @@ using System.Windows.Forms;
using System.IO;
using XenAdmin.Core;
using XenAdmin;
using XenAPI;
namespace XenAdmin.Commands
{
@ -82,8 +83,11 @@ namespace XenAdmin.Commands
private static bool CanExecute(SelectedItem selection)
{
if(selection.Connection != null && selection.Connection.IsConnected && selection.PoolAncestor != null)
return !Helpers.FeatureForbidden(selection.Connection, XenAPI.Host.RestrictExportResourceData);
bool isPoolOrStandalone = selection.XenObject is Pool
|| (selection.XenObject is Host && Helpers.GetPool(selection.Connection) == null);
if (selection.Connection != null && selection.Connection.IsConnected && isPoolOrStandalone)
return !Helpers.FeatureForbidden(selection.Connection, Host.RestrictExportResourceData);
return false;
}