Merge pull request #1799 from jijiang/master

CA-267553: Fix offline XC showing up to date bug
This commit is contained in:
Mihaela Stoica 2017-10-03 20:33:18 +01:00 committed by GitHub
commit d2c80cddbc
2 changed files with 2 additions and 23 deletions

View File

@ -866,7 +866,7 @@ namespace XenAdmin.Core
return alert;
}
private static List<XenServerVersion> GetServerVersions(Host host, List<XenServerVersion> xenServerVersions)
public static List<XenServerVersion> GetServerVersions(Host host, List<XenServerVersion> xenServerVersions)
{
var serverVersions = xenServerVersions.FindAll(version =>
{

View File

@ -461,28 +461,7 @@ namespace XenAdmin.TabPages
private bool VersionFoundInUpdatesXml(IXenConnection connection)
{
if (connection == null)
return false;
List<Host> hosts = connection.Cache.Hosts.ToList();
foreach (Host host in hosts)
{
var hostVersions = Updates.XenServerVersions.FindAll(version =>
{
if (version.BuildNumber != string.Empty)
return (host.BuildNumberRaw() == version.BuildNumber);
return Helpers.HostProductVersionWithOEM(host) == version.VersionAndOEM
|| (version.Oem != null && Helpers.OEMName(host).StartsWith(version.Oem)
&& Helpers.HostProductVersion(host) == version.Version.ToString());
});
if (hostVersions.Count == 0)
return false;
}
return true;
return connection.Cache.Hosts.All(h => Updates.GetServerVersions(h, Updates.XenServerVersions).Count > 0);
}
private void RebuildHostView()