mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
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:
parent
b0cdc74188
commit
d58131910b
@ -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,18 +646,15 @@ 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)
|
||||
{
|
||||
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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user