From b783bff44401ff5f3e0203874716306d4d482b40 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Mon, 24 Jul 2017 15:05:14 +0100 Subject: [PATCH] CA-260364: Pool join in XenCenter: Use homogeneity flag from other_config for Ely/Honolulu hosts (#1710) Signed-off-by: Mihaela Stoica --- XenModel/PoolJoinRules.cs | 4 ++-- XenModel/XenAPI-Extensions/Pool_update.cs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/XenModel/PoolJoinRules.cs b/XenModel/PoolJoinRules.cs index 6d186ae3c..1a8956405 100644 --- a/XenModel/PoolJoinRules.cs +++ b/XenModel/PoolJoinRules.cs @@ -409,8 +409,8 @@ namespace XenAdmin.Core if (!Helpers.ElyOrGreater(slave) || !Helpers.ElyOrGreater(master)) return false; - var masterUpdates = master.AppliedUpdates().Where(update => update.enforce_homogeneity).Select(update => update.uuid).ToList(); - var slaveUpdates = slave.AppliedUpdates().Where(update => update.enforce_homogeneity).Select(update => update.uuid).ToList(); + var masterUpdates = master.AppliedUpdates().Where(update => update.EnforceHomogeneity).Select(update => update.uuid).ToList(); + var slaveUpdates = slave.AppliedUpdates().Where(update => update.EnforceHomogeneity).Select(update => update.uuid).ToList(); return masterUpdates.Count != slaveUpdates.Count || !masterUpdates.All(slaveUpdates.Contains); } diff --git a/XenModel/XenAPI-Extensions/Pool_update.cs b/XenModel/XenAPI-Extensions/Pool_update.cs index 386e5fd4a..14df05d79 100644 --- a/XenModel/XenAPI-Extensions/Pool_update.cs +++ b/XenModel/XenAPI-Extensions/Pool_update.cs @@ -74,5 +74,18 @@ namespace XenAPI this.Connection.Cache.Hosts.Where(h => this.AppliedOn(h)).ToList(); } } + + private string enforce_homogeneity_key = "enforce_homogeneity"; + + public bool EnforceHomogeneity + { + get + { + if (Helpers.InvernessOrGreater(Connection)) + return enforce_homogeneity; + var poolPatchOfUpdate = Connection.Cache.Pool_patches.FirstOrDefault(p => p.pool_update != null && p.pool_update.opaque_ref == opaque_ref); + return poolPatchOfUpdate != null && BoolKey(poolPatchOfUpdate.other_config, enforce_homogeneity_key); + } + } } }