mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CP-18417: Simplifying the automatic enabled/disabled logic.
Automatic is disabled if any pool forbids auto restart (per Neptune), and reboot is required. It's also disabled if the update type isn't one of the three in the switch statement. If it's enabled it is checked by default.
This commit is contained in:
parent
8639660562
commit
a548c21120
@ -86,31 +86,29 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
|
||||
var automaticDisabled = anyPoolForbidsAutoRestart && patchRequiresReboot;
|
||||
|
||||
if (automaticDisabled)
|
||||
{
|
||||
AutomaticRadioButton.Checked = false;
|
||||
AutomaticRadioButton.Enabled = false;
|
||||
}
|
||||
|
||||
switch (SelectedUpdateType)
|
||||
{
|
||||
case UpdateType.NewRetail:
|
||||
case UpdateType.Existing:
|
||||
textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, Patch);
|
||||
if (!automaticDisabled)
|
||||
{
|
||||
AutomaticRadioButton.Enabled = true;
|
||||
AutomaticRadioButton.Checked = true;
|
||||
}
|
||||
break;
|
||||
case UpdateType.NewSuppPack:
|
||||
textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeSuppPack(SelectedServers);
|
||||
if (!automaticDisabled)
|
||||
{
|
||||
AutomaticRadioButton.Enabled = true;
|
||||
AutomaticRadioButton.Checked = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
automaticDisabled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (automaticDisabled)
|
||||
{
|
||||
AutomaticRadioButton.Checked = false;
|
||||
AutomaticRadioButton.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
AutomaticRadioButton.Enabled = true;
|
||||
AutomaticRadioButton.Checked = true;
|
||||
}
|
||||
|
||||
if (SelectedUpdateType == UpdateType.NewSuppPack || SelectedServers.Exists(server => !Helpers.ClearwaterOrGreater(server)))
|
||||
|
Loading…
Reference in New Issue
Block a user