mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Merge pull request #516 from MihaelaStoica/CP-12154
CP-12154: Check whether the Health Check feature is available before…
This commit is contained in:
commit
2210d480ae
@ -1,6 +1,6 @@
|
||||
using System.Linq;
|
||||
using XenAdmin.Dialogs;
|
||||
using XenAdmin.Dialogs.CallHome;
|
||||
using XenAdmin.Core;
|
||||
using XenAPI;
|
||||
|
||||
namespace XenAdmin.Commands
|
||||
{
|
||||
@ -27,7 +27,8 @@ namespace XenAdmin.Commands
|
||||
|
||||
protected override bool CanExecuteCore(SelectedItemCollection selection)
|
||||
{
|
||||
return ConnectionsManager.XenConnectionsCopy.Any(xenConnection => xenConnection.IsConnected);
|
||||
return ConnectionsManager.XenConnectionsCopy.Any(xenConnection => xenConnection.IsConnected
|
||||
&& !Helpers.FeatureForbidden(xenConnection, Host.RestrictHealthCheck));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ namespace XenAdmin.Dialogs.CallHome
|
||||
var list = new List<DataGridViewRow>();
|
||||
foreach (IXenConnection xenConnection in ConnectionsManager.XenConnectionsCopy)
|
||||
{
|
||||
if (!xenConnection.IsConnected)
|
||||
if (!xenConnection.IsConnected || Helpers.FeatureForbidden(xenConnection, Host.RestrictHealthCheck))
|
||||
continue;
|
||||
var pool = Helpers.GetPoolOfOne(xenConnection);
|
||||
if (pool != null)
|
||||
|
@ -162,6 +162,9 @@ namespace XenAdmin.Dialogs
|
||||
/// <param name="connection">The connection to check enrollment on</param>
|
||||
internal bool CheckHealthCheckEnrollment(IXenConnection connection)
|
||||
{
|
||||
if (Helpers.FeatureForbidden(connection, Host.RestrictHealthCheck))
|
||||
return false;
|
||||
|
||||
Pool pool = Helpers.GetPoolOfOne(connection);
|
||||
if (pool == null)
|
||||
return false;
|
||||
|
@ -474,6 +474,16 @@ namespace XenAPI
|
||||
return h._RestrictReadCaching;
|
||||
}
|
||||
|
||||
private bool _RestrictHealthCheck
|
||||
{
|
||||
get { return BoolKeyPreferTrue(license_params, "restrict_health_check"); }
|
||||
}
|
||||
|
||||
public static bool RestrictHealthCheck(Host h)
|
||||
{
|
||||
return h._RestrictHealthCheck;
|
||||
}
|
||||
|
||||
public bool HasPBDTo(SR sr)
|
||||
{
|
||||
foreach (XenRef<PBD> pbd in PBDs)
|
||||
|
Loading…
Reference in New Issue
Block a user