Merge pull request #1516 from GaborApatiNagy/REQ-411_2

CP-21504: Added pre-check for restart (for the version update)
This commit is contained in:
Mihaela Stoica 2017-03-27 15:59:06 +01:00 committed by GitHub
commit dfb0a246bb

View File

@ -419,6 +419,26 @@ namespace XenAdmin.Wizards.PatchingWizard
} }
} }
//Checking reboot required and can evacuate host for version updates
if (WizardMode == Wizards.PatchingWizard.WizardMode.NewVersion && UpdateAlert != null && UpdateAlert.Patch != null && UpdateAlert.Patch.after_apply_guidance == after_apply_guidance.restartHost)
{
checks.Add(new KeyValuePair<string, List<Check>>(Messages.CHECKING_SERVER_NEEDS_REBOOT, new List<Check>()));
checkGroup = checks[checks.Count - 1].Value;
var guidance = new List<after_apply_guidance>() { UpdateAlert.Patch.after_apply_guidance };
foreach (var host in SelectedServers)
{
checkGroup.Add(new HostNeedsRebootCheck(host, guidance, LivePatchCodesByHost));
}
checks.Add(new KeyValuePair<string, List<Check>>(Messages.CHECKING_CANEVACUATE_STATUS, new List<Check>()));
checkGroup = checks[checks.Count - 1].Value;
foreach (Host host in SelectedServers)
{
checkGroup.Add(new AssertCanEvacuateCheck(host, LivePatchCodesByHost));
}
}
return checks; return checks;
} }
@ -442,7 +462,7 @@ namespace XenAdmin.Wizards.PatchingWizard
} }
//Checking if the host needs a reboot //Checking if the host needs a reboot
if (WizardMode != WizardMode.SingleUpdate) if (WizardMode == WizardMode.SingleUpdate)
{ {
checks.Add(new KeyValuePair<string, List<Check>>(Messages.CHECKING_SERVER_NEEDS_REBOOT, new List<Check>())); checks.Add(new KeyValuePair<string, List<Check>>(Messages.CHECKING_SERVER_NEEDS_REBOOT, new List<Check>()));
checkGroup = checks[checks.Count - 1].Value; checkGroup = checks[checks.Count - 1].Value;
@ -458,7 +478,7 @@ namespace XenAdmin.Wizards.PatchingWizard
//Checking can evacuate host //Checking can evacuate host
//CA-97061 - evacuate host -> suspended VMs. This is only needed for restartHost //CA-97061 - evacuate host -> suspended VMs. This is only needed for restartHost
//Also include this check for the supplemental packs (patch == null), as their guidance is restartHost //Also include this check for the supplemental packs (patch == null), as their guidance is restartHost
if (patch == null || patch.after_apply_guidance.Contains(after_apply_guidance.restartHost)) if (WizardMode != WizardMode.NewVersion && (patch == null || patch.after_apply_guidance.Contains(after_apply_guidance.restartHost)))
{ {
checks.Add(new KeyValuePair<string, List<Check>>(Messages.CHECKING_CANEVACUATE_STATUS, new List<Check>())); checks.Add(new KeyValuePair<string, List<Check>>(Messages.CHECKING_CANEVACUATE_STATUS, new List<Check>()));
checkGroup = checks[checks.Count - 1].Value; checkGroup = checks[checks.Count - 1].Value;