Corrected logic checking the host is up to date. Renamed method because the old name was not descriptive of the output.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-06-04 12:40:30 +01:00
parent b0cdc74188
commit d58131910b
2 changed files with 7 additions and 27 deletions

View File

@ -609,7 +609,7 @@ namespace XenAdmin.Core
foreach (Host h in hosts)
{
uSeq[h] = GetUpgradeSequenceForHost(h, uSeq.MinimalPatches);
uSeq[h] = GetPatchSequenceForHost(h, uSeq.MinimalPatches);
}
return uSeq;
@ -646,8 +646,7 @@ namespace XenAdmin.Core
// the pool has to be homogeneous
if (version != null)
{
uSeq.MinimalPatches = new List<XenServerPatch>();
uSeq.MinimalPatches.Add(alert.Patch);
uSeq.MinimalPatches = new List<XenServerPatch> {alert.Patch};
// if it's a version updgrade the min sequence will be this patch (the upgrade) and the min patches for the new version
if (updateTheNewVersion && alert.NewServerVersion != null && alert.NewServerVersion.MinimalPatches != null)
@ -655,9 +654,7 @@ namespace XenAdmin.Core
uSeq.MinimalPatches.AddRange(alert.NewServerVersion.MinimalPatches);
}
conn.Cache.Hosts.ToList().ForEach(h =>
uSeq[h] = GetUpgradeSequenceForHost(h, uSeq.MinimalPatches)
);
conn.Cache.Hosts.ToList().ForEach(h => uSeq[h] = GetPatchSequenceForHost(h, uSeq.MinimalPatches));
return uSeq;
}
@ -707,7 +704,7 @@ namespace XenAdmin.Core
return commonXenServerVersion;
}
private static List<XenServerPatch> GetUpgradeSequenceForHost(Host h, List<XenServerPatch> latestPatches)
private static List<XenServerPatch> GetPatchSequenceForHost(Host h, List<XenServerPatch> latestPatches)
{
var sequence = new List<XenServerPatch>();
var appliedUpdateUuids = new List<string>();
@ -791,23 +788,6 @@ namespace XenAdmin.Core
}
}
public bool AllHostsUpToDate
{
get
{
if (this.Count == 0)
return false;
foreach (var host in this.Keys)
{
if (this[host].Count > 0)
return false;
}
return true;
}
}
public List<XenServerPatch> MinimalPatches
{
set;

View File

@ -231,8 +231,8 @@ namespace XenAdmin.Wizards.PatchingWizard
return;
}
//if all hosts are up-to-date
if (us.AllHostsUpToDate)
//if host is up to date
if (!us.Keys.Contains(host) || us[host].Count == 0)
{
row.Enabled = false;
row.Cells[3].ToolTipText = Messages.PATCHINGWIZARD_SELECTSERVERPAGE_SERVER_UP_TO_DATE;