Skip to content

Commit

Permalink
Merge pull request #3202 from kc284/supp-pack
Browse files Browse the repository at this point in the history
Wording change; corrections for supp-pack installation.
  • Loading branch information
kc284 authored Aug 17, 2023
2 parents 351c652 + 82f5522 commit fdd5ca7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 48 deletions.
22 changes: 10 additions & 12 deletions XenAdmin/Diagnostics/Checks/HostNeedsRebootCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/TabPages/GeneralTabPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
43 changes: 22 additions & 21 deletions XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 4 additions & 8 deletions XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,12 @@ private List<CheckGroup> GenerateCommonChecks(List<Host> 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
Expand Down
4 changes: 2 additions & 2 deletions XenModel/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions XenModel/Messages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -7195,10 +7195,10 @@ This might result in failure to migrate VMs to this server during the RPU or to
<value>1 new feature</value>
</data>
<data name="HOTFIX_TYPE_PREVIEW_FEATURE_MANY" xml:space="preserve">
<value>{0} feature previews</value>
<value>{0} preview features</value>
</data>
<data name="HOTFIX_TYPE_PREVIEW_FEATURE_ONE" xml:space="preserve">
<value>1 feature preview</value>
<value>1 preview feature</value>
</data>
<data name="HOTFIX_TYPE_SECURITY_FIX_MANY" xml:space="preserve">
<value>{0} security fixes</value>
Expand Down

0 comments on commit fdd5ca7

Please sign in to comment.