Added parameter enableOnly defaulting to false to the RestartHostPlanAction

so as to be able to evacuate-reboot the host without bringing the VMs back.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-03-07 17:50:51 +00:00
parent 4b6e826ed3
commit b3828ef452
2 changed files with 5 additions and 3 deletions

View File

@ -185,7 +185,7 @@ namespace XenAdmin.Wizards.PatchingWizard
{
var action = patch.after_apply_guidance == after_apply_guidance.restartXAPI &&
delayedActionsByHost[host].Any(a => a is RestartHostPlanAction)
? new RestartHostPlanAction(host, host.GetRunningVMs(), true)
? new RestartHostPlanAction(host, host.GetRunningVMs(), restartAgentFallback:true)
: GetAfterApplyGuidanceAction(host, patch.after_apply_guidance);
if (action != null)

View File

@ -40,13 +40,15 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
public class RestartHostPlanAction : RebootPlanAction
{
private readonly List<XenRef<VM>> _vms;
private readonly bool _enableOnly;
private readonly bool _restartAgentFallback;
public RestartHostPlanAction(Host host, List<XenRef<VM>> vms, bool restartAgentFallback = false)
public RestartHostPlanAction(Host host, List<XenRef<VM>> vms, bool enableOnly = false, bool restartAgentFallback = false)
: base(host, string.Empty)
{
_vms = vms;
Visible = false;
_enableOnly = enableOnly;
_restartAgentFallback = restartAgentFallback;
}
@ -83,7 +85,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
EvacuateHost(ref session);
RebootHost(ref session);
BringBabiesBack(ref session, _vms, false);
BringBabiesBack(ref session, _vms, _enableOnly);
}
}
}