diff --git a/XenAdmin/Diagnostics/Checks/HostNeedsRebootCheck.cs b/XenAdmin/Diagnostics/Checks/HostNeedsRebootCheck.cs index 339e43109..3efb934ba 100644 --- a/XenAdmin/Diagnostics/Checks/HostNeedsRebootCheck.cs +++ b/XenAdmin/Diagnostics/Checks/HostNeedsRebootCheck.cs @@ -74,17 +74,15 @@ public HostNeedsRebootCheck(Host host) protected override Problem RunHostCheck() { - if (Helpers.CloudOrGreater(Host)) - { + if (Helpers.CloudOrGreater(Host) && livePatchCodesByHost == null) return new HostNeedsReboot(this, Host); - } - var updateSequenceIsLivePatchable = restartHostPatches != null && restartHostPatches.Count > 0 && restartHostPatches.All(p => p.ContainsLivepatch); + var updateSequenceIsLivePatchable = restartHostPatches != null && restartHostPatches.Count > 0 && + restartHostPatches.All(p => p.ContainsLivepatch); + var hostHasBeenLivePatched = livePatchCodesByHost != null && livePatchCodesByHost.ContainsKey(Host.uuid) && + livePatchCodesByHost[Host.uuid] == livepatch_status.ok_livepatch_complete; - // when livepatching is available, no restart is expected - if (livePatchCodesByHost != null && livePatchCodesByHost.ContainsKey(Host.uuid) && - livePatchCodesByHost[Host.uuid] == livepatch_status.ok_livepatch_complete - || updateSequenceIsLivePatchable) + if (hostHasBeenLivePatched || updateSequenceIsLivePatchable) { var livePatchingRestricted = Helpers.FeatureForbidden(Host.Connection, Host.RestrictLivePatching); var livePatchingRDisabled = Helpers.GetPoolOfOne(Host.Connection)?.live_patching_disabled == true; @@ -96,11 +94,11 @@ protected override Problem RunHostCheck() return null; } - if ((updateGuidance != null && updateGuidance.Contains(update_after_apply_guidance.restartHost)) - || (patchGuidance != null && patchGuidance.Contains(after_apply_guidance.restartHost)) - || (restartHostPatches != null && restartHostPatches.Count > 0)) + if (updateGuidance != null && updateGuidance.Contains(update_after_apply_guidance.restartHost) || + patchGuidance != null && patchGuidance.Contains(after_apply_guidance.restartHost) || + restartHostPatches != null && restartHostPatches.Count > 0) { - return new HostNeedsReboot(this, Host); + return new HostNeedsReboot(this, Host); } successfulCheckDescription = string.Format(Messages.UPDATES_WIZARD_NO_REBOOT_NEEDED, Host); diff --git a/XenAdmin/TabPages/GeneralTabPage.cs b/XenAdmin/TabPages/GeneralTabPage.cs index 6357ad262..bb10d9e59 100644 --- a/XenAdmin/TabPages/GeneralTabPage.cs +++ b/XenAdmin/TabPages/GeneralTabPage.cs @@ -555,10 +555,9 @@ private void GeneratePoolUpdatesBox() var allHostCount = xenObject.Connection.Cache.HostCount; if (Helpers.CloudOrGreater(pool.Connection)) - { GenerateCdnUpdatesBox(pool); - } - else if (Helpers.ElyOrGreater(xenObject.Connection)) + + if (Helpers.ElyOrGreater(xenObject.Connection)) { foreach (var u in cache.Pool_updates) { diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs index 054c90dcb..81748088e 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs @@ -79,30 +79,31 @@ protected override void PageLoadedCore(PageLoadedDirection direction) bool someHostMayRequireRestart; bool automaticDisabled; - if (IsNewGeneration) + switch (SelectedUpdateType) { - ManualTextInstructions = ModeCdnUpdates(); - automaticDisabled = anyPoolForbidsAutostart; - } - else - { - switch (SelectedUpdateType) - { - case UpdateType.Legacy: + case UpdateType.Legacy: + if (IsNewGeneration) + { + ManualTextInstructions = ModeCdnUpdates(); + automaticDisabled = anyPoolForbidsAutostart; + } + else + { ManualTextInstructions = ModePoolPatch(out someHostMayRequireRestart); automaticDisabled = anyPoolForbidsAutostart && someHostMayRequireRestart; - break; - case UpdateType.ISO: - ManualTextInstructions = PoolUpdate != null - ? ModePoolUpdate(out someHostMayRequireRestart) - : ModeSuppPack(out someHostMayRequireRestart); - automaticDisabled = anyPoolForbidsAutostart && someHostMayRequireRestart; - break; - default: - ManualTextInstructions = null; - automaticDisabled = true; - break; - } + } + + break; + case UpdateType.ISO: + ManualTextInstructions = PoolUpdate != null + ? ModePoolUpdate(out someHostMayRequireRestart) + : ModeSuppPack(out someHostMayRequireRestart); + automaticDisabled = anyPoolForbidsAutostart && someHostMayRequireRestart; + break; + default: + ManualTextInstructions = null; + automaticDisabled = true; + break; } if (ManualTextInstructions == null || ManualTextInstructions.Count == 0) diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs index 9cceb9c84..b7272a82e 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs @@ -414,16 +414,12 @@ private List GenerateCommonChecks(List applicableServers) if (host == null) continue; - if (hostUpdateInfo.RecommendedGuidance.Contains(CdnGuidance.RebootHost)) - { + var guidance = hostUpdateInfo.RecommendedGuidance; + + if (guidance.Contains(CdnGuidance.RebootHost)) rebootChecks.Add(new HostNeedsRebootCheck(host)); + if (guidance.Contains(CdnGuidance.RebootHost) || guidance.Contains(CdnGuidance.EvacuateHost)) evacuateChecks.Add(new AssertCanEvacuateCheck(host)); - } - else if (hostUpdateInfo.RecommendedGuidance.Contains(CdnGuidance.EvacuateHost) || - hostUpdateInfo.RecommendedGuidance.Contains(CdnGuidance.RestartToolstack)) - { - evacuateChecks.Add(new AssertCanEvacuateCheck(host)); - } } } else diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 1e3a72e7b..11cc67d82 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -20613,7 +20613,7 @@ public static string HOTFIX_TYPE_NEW_FEATURE_ONE { } /// - /// Looks up a localized string similar to {0} feature previews. + /// Looks up a localized string similar to {0} preview features. /// public static string HOTFIX_TYPE_PREVIEW_FEATURE_MANY { get { @@ -20622,7 +20622,7 @@ public static string HOTFIX_TYPE_PREVIEW_FEATURE_MANY { } /// - /// Looks up a localized string similar to 1 feature preview. + /// Looks up a localized string similar to 1 preview feature. /// public static string HOTFIX_TYPE_PREVIEW_FEATURE_ONE { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 4e79a4f21..d699e3dad 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -7195,10 +7195,10 @@ This might result in failure to migrate VMs to this server during the RPU or to 1 new feature - {0} feature previews + {0} preview features - 1 feature preview + 1 preview feature {0} security fixes