mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
CP-25564: Added condition for maintenance mode and clustering
Signed-off-by: serenc <seren.corbett@citrix.com>
This commit is contained in:
parent
dd2bde777a
commit
ea7c9b76f2
@ -36,6 +36,7 @@ using System.Linq;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using XenAdmin.Controls;
|
using XenAdmin.Controls;
|
||||||
using XenAdmin.Core;
|
using XenAdmin.Core;
|
||||||
|
using XenAPI;
|
||||||
|
|
||||||
|
|
||||||
namespace XenAdmin.Dialogs
|
namespace XenAdmin.Dialogs
|
||||||
@ -166,15 +167,18 @@ namespace XenAdmin.Dialogs
|
|||||||
haEnabledRubric.Enabled =
|
haEnabledRubric.Enabled =
|
||||||
true;
|
true;
|
||||||
}
|
}
|
||||||
if (network != null)
|
|
||||||
{
|
|
||||||
var master = Helpers.GetMaster(network.Connection);
|
|
||||||
var clusteringEnabled = network.Connection.Cache.Cluster_hosts.Any(cluster =>
|
|
||||||
cluster.host.opaque_ref == master.opaque_ref && cluster.enabled);
|
|
||||||
var existingCluster = network.Connection.Cache.Clusters.FirstOrDefault();
|
|
||||||
|
|
||||||
if (clusteringEnabled && existingCluster != null &&
|
var pif = (PIF) Tag;
|
||||||
existingCluster.network.opaque_ref == network.opaque_ref)
|
var existingCluster = network != null ? network.Connection.Cache.Clusters.FirstOrDefault() : null;
|
||||||
|
|
||||||
|
if (pif != null && existingCluster != null && existingCluster.network.opaque_ref == network.opaque_ref)
|
||||||
|
{
|
||||||
|
Host host = network.Connection.Resolve(pif.host);
|
||||||
|
|
||||||
|
var clusteringEnabled = network.Connection.Cache.Cluster_hosts.Any(cluster =>
|
||||||
|
cluster.host.opaque_ref == host.opaque_ref && cluster.enabled);
|
||||||
|
|
||||||
|
if (clusteringEnabled && host.enabled)
|
||||||
{
|
{
|
||||||
DisableControls("DisableForClustering",
|
DisableControls("DisableForClustering",
|
||||||
string.Format(Messages.CANNOT_CHANGE_IP_CLUSTERING_ENABLED, network.Name()));
|
string.Format(Messages.CANNOT_CHANGE_IP_CLUSTERING_ENABLED, network.Name()));
|
||||||
|
Loading…
Reference in New Issue
Block a user