CP-41923: Update RPU005 to version 5.0

Also:
- Add `HostDoesNotHaveHotfixWarning` warning to EUA `Check` when necessary
- Filter our `null` EUAs before passing them to the `Problem`

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
Danilo Del Busso 2023-06-05 09:33:41 +01:00 committed by Konstantina Chremmou
parent 58be7ff5f9
commit 6ce22f759a
4 changed files with 22 additions and 9 deletions

View File

@ -36,6 +36,8 @@ using XenAdmin.Core;
using XenAPI;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.UtilityProblem;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems.HostProblem;
namespace XenAdmin.Diagnostics.Checks
{
@ -90,6 +92,13 @@ namespace XenAdmin.Diagnostics.Checks
}
protected override Problem RunCheck()
{
foreach (var host in Hosts)
{
var hotfix = HotfixFactory.Hotfix(host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(host))
return new HostDoesNotHaveHotfixWarning(this, host);
}
Hosts.AsParallel().ForAll(FetchHostEua);
lock (_hostsFailedToFetchEua)
{
@ -100,7 +109,7 @@ namespace XenAdmin.Diagnostics.Checks
}
lock (_euas)
{
return new EuaNotAcceptedProblem( _control, this, _euas.ToList());
return new EuaNotAcceptedProblem( _control, this, _euas.Where(eua => eua != null).ToList());
}
}

View File

@ -41,10 +41,10 @@ namespace XenAdmin.Diagnostics.Hotfixing
Stockholm
}
private static readonly Hotfix stockholmHotfix = new SingleHotfix
private static readonly Hotfix StockholmHotfix = new SingleHotfix
{
Filename = "RPU005",
UUID = "f9f63a51-509f-46fc-8c99-820fcac2228c"
UUID = "38a7eeeb-31ec-4de3-934f-13929ad3e339"
};
public static Hotfix Hotfix(Host host)
@ -57,7 +57,7 @@ namespace XenAdmin.Diagnostics.Hotfixing
public static Hotfix Hotfix(HotfixableServerVersion version)
{
if (version == HotfixableServerVersion.Stockholm)
return stockholmHotfix;
return StockholmHotfix;
throw new ArgumentException("A version was provided for which there is no hotfix filename");
}

View File

@ -167,10 +167,14 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard
if (hotfixChecks.Count > 0)
groups.Add(new CheckGroup(Messages.CHECKING_UPGRADE_HOTFIX_STATUS, hotfixChecks));
// EUA check
var euaCheck = GetPermanentCheck("EUA", new UpgradeRequiresEua(this, hostsToUpgrade, InstallMethodConfig));
var euaChecks = new List<Check> { euaCheck };
groups.Add(new CheckGroup(Messages.ACCEPT_EUA_CHECK_GROUP_NAME, euaChecks));
if (!ManualUpgrade)
{
// EUA check
var euaCheck = GetPermanentCheck("EUA",
new UpgradeRequiresEua(this, hostsToUpgrade, InstallMethodConfig));
var euaChecks = new List<Check> { euaCheck };
groups.Add(new CheckGroup(Messages.ACCEPT_EUA_CHECK_GROUP_NAME, euaChecks));
}
//SafeToUpgrade- and PrepareToUpgrade- checks - in automatic mode only, for hosts that will be upgraded
if (!ManualUpgrade)

View File

@ -1,7 +1,7 @@
{
"files": [
{
"pattern": "builds/xs/hotfixes/trunk/RPU005/4.0/RPU005.iso",
"pattern": "builds/xs/hotfixes/trunk/RPU005/5.0/RPU005.iso",
"target": "xenadmin.git/Branding/Hotfixes/RPU005.iso",
"flat": "true"
}