Merge branch 'master' into CAR-2184

This commit is contained in:
Mihaela Stoica 2016-09-30 14:46:26 +01:00
commit cdfec90fa8
4 changed files with 14 additions and 16 deletions

View File

@ -369,8 +369,8 @@ namespace XenAdmin.Wizards.PatchingWizard
public enum LivePatchCode
{
UNKNOWN,
PATCH_PRECHECK_LIVEPATCH_COMPLETE, // An applicable live patch exists for every required component
PATCH_PRECHECK_LIVEPATCH_INCOMPLETE, // An applicable live patch exists but it is not sufficient
PATCH_PRECHECK_LIVEPATCH_MISSING, // There is no applicable live patch
PATCH_PRECHECK_LIVEPATCH_COMPLETE, // An applicable live patch exists for every required component
PATCH_PRECHECK_LIVEPATCH_INCOMPLETE, // An applicable live patch exists but it is not sufficient
PATCH_PRECHECK_LIVEPATCH_NOT_APPLICABLE, // There is no applicable live patch
}
}
}

View File

@ -64,6 +64,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
protected override void RunWithSession(ref Session session)
{
// If there are no patches that require reboot, we skip the evacuate-reboot-bringbabiesback sequence
if (Helpers.ElyOrGreater(currentHost) && AvoidRestartHosts != null && AvoidRestartHosts.Contains(currentHost.uuid))
{
log.Debug("Skipped scheduled restart (livepatching succeeded), BringBabiesBackAction is skipped.");

View File

@ -60,23 +60,22 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
Host hostObject = TryResolveWithTimeout(_host);
if (Helpers.ElyOrGreater(hostObject))
// If there are no patches that require reboot, we skip the evacuate-reboot-bringbabiesback sequence
// But we only do this if we indicated that host restart should be avoided (by initializing the AvoidRestartHosts property)
if (Helpers.ElyOrGreater(hostObject) && AvoidRestartHosts != null)
{
log.DebugFormat("Checking host.patches_requiring_reboot now on '{0}'...", hostObject);
if (hostObject.patches_requiring_reboot.Count > 0)
{
if (AvoidRestartHosts != null)
AvoidRestartHosts.Remove(hostObject.uuid);
AvoidRestartHosts.Remove(hostObject.uuid);
log.DebugFormat("Restart is needed now (hostObject.patches_requiring_reboot has {0} items in it). Evacuating now. Will restart after.", hostObject.patches_requiring_reboot.Count);
}
else
{
if (AvoidRestartHosts != null && !AvoidRestartHosts.Contains(hostObject.uuid))
{
if (!AvoidRestartHosts.Contains(hostObject.uuid))
AvoidRestartHosts.Add(hostObject.uuid);
}
log.Debug("Will skip scheduled restart (livepatching succeeded), because hostObject.patches_requiring_reboot is empty.");

View File

@ -52,14 +52,12 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
protected override void RunWithSession(ref Session session)
{
if (Helpers.ElyOrGreater(_host))
// If there are no patches that require reboot, we skip the evacuate-reboot-bringbabiesback sequence
if (Helpers.ElyOrGreater(_host) && AvoidRestartHosts != null && AvoidRestartHosts.Contains(_host.uuid))
{
if (AvoidRestartHosts != null && AvoidRestartHosts.Contains(_host.uuid))
{
log.Debug("Skipping scheduled restart (livepatching succeeded). RebootHostPlanAction is skipped.");
log.Debug("Skipping scheduled restart (livepatching succeeded). RebootHostPlanAction is skipped.");
return;
}
return;
}
visible = true;