CA-293311: RPU wizard: Only check the maintenance mode on hosts that need to be upgraded (and check host liveness on the hosts where we will only apply updates)

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2018-07-06 15:59:29 +01:00 committed by Konstantina Chremmou
parent 1ac88b7cec
commit a511124b82
2 changed files with 8 additions and 2 deletions

View File

@ -37,9 +37,12 @@ namespace XenAdmin.Diagnostics.Checks
{
class HostMaintenanceModeCheck : HostLivenessCheck
{
public HostMaintenanceModeCheck(Host host)
private readonly bool checkHostLivenessOnly;
public HostMaintenanceModeCheck(Host host, bool checkHostLivenessOnly = false)
: base(host)
{
this.checkHostLivenessOnly = checkHostLivenessOnly;
}
protected override Problem RunCheck()
@ -48,6 +51,9 @@ namespace XenAdmin.Diagnostics.Checks
if (problem != null)
return problem;
if (checkHostLivenessOnly)
return null;
// Check the host is not in Maintenance Mode (or disabled)
if (Host.MaintenanceMode() || !Host.enabled)
{

View File

@ -164,7 +164,7 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard
//HostMaintenanceModeCheck checks - for hosts that will be upgraded or updated
var livenessChecks = new List<Check>();
foreach (Host host in hostsToUpgradeOrUpdate)
livenessChecks.Add(new HostMaintenanceModeCheck(host));
livenessChecks.Add(new HostMaintenanceModeCheck(host, !hostsToUpgrade.Contains(host)));
groups.Add(new CheckGroup(Messages.CHECKING_HOST_LIVENESS_STATUS, livenessChecks));
//HA checks - for each pool