public override void PageLoaded(PageLoadedDirection direction)
        {
            base.PageLoaded(direction);

            textBoxLog.Clear();

            switch (SelectedUpdateType)
            {
            case UpdateType.NewRetail:
            case UpdateType.Existing:
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, Patch);
                AutomaticRadioButton.Enabled = true;
                AutomaticRadioButton.Checked = true;
                break;

            case UpdateType.NewSuppPack:
                AutomaticRadioButton.Enabled = true;
                AutomaticRadioButton.Checked = true;
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeSuppPack(SelectedServers);
                break;
            }

            if (SelectedUpdateType == UpdateType.NewSuppPack || SelectedServers.Exists(server => !Helpers.ClearwaterOrGreater(server)))
            {
                removeUpdateFileCheckBox.Checked = false;
                removeUpdateFileCheckBox.Visible = false;
            }
        }
 private Mock<Pool_patch> SetupBuilder(after_apply_guidance guidance, out string msg, out Mock<Host> host)
 {
     PatchingWizardModeGuidanceBuilder builder = new PatchingWizardModeGuidanceBuilder();
     Mock<Pool_patch> patch = ObjectManager.NewXenObject<Pool_patch>(id);
     host = ObjectManager.NewXenObject<Host>(id);
     host.Setup(h => h.IsMaster()).Returns(true);
     host.Setup(h => h.Name).Returns("MyHost");
     patch.Setup(p => p.after_apply_guidance).Returns(new List<after_apply_guidance> { guidance });
     msg = builder.ModeRetailPatch(new List<Host>{host.Object}, patch.Object);
     return patch;
 }
Exemple #3
0
        public override void PageLoaded(PageLoadedDirection direction)
        {
            base.PageLoaded(direction);

            textBoxLog.Clear();

            var unknownType = false;

            var someHostMayRequireRestart = false; // If a host has restartHost guidance, even if is a live patch,  we want this true (as live patch may fail)

            switch (SelectedUpdateType)
            {
            case UpdateType.NewRetail:
            case UpdateType.Existing:
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, Patch, out someHostMayRequireRestart);
                break;

            case UpdateType.ISO:
                AutomaticRadioButton.Enabled = true;
                AutomaticRadioButton.Checked = true;
                textBoxLog.Text = PoolUpdate != null
                        ? PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, PoolUpdate, LivePatchCodesByHost, out someHostMayRequireRestart)
                        : PatchingWizardModeGuidanceBuilder.ModeSuppPack(SelectedServers, out someHostMayRequireRestart);

                break;

            default:
                unknownType = true;
                break;
            }

            var automaticDisabled = unknownType || (AnyPoolForbidsAutoRestart() && someHostMayRequireRestart);

            AutomaticRadioButton.Enabled = !automaticDisabled;
            AutomaticRadioButton.Checked = !automaticDisabled;
            ManualRadioButton.Checked    = automaticDisabled;

            if (automaticDisabled)
            {
                tableLayoutPanel1.MouseMove += tableLayoutPanel1_MouseMove;
            }

            if (SelectedUpdateType == UpdateType.ISO || SelectedServers.Exists(server => !Helpers.ClearwaterOrGreater(server)))
            {
                removeUpdateFileCheckBox.Checked = false;
                removeUpdateFileCheckBox.Visible = false;
            }
        }
        public override void PageLoaded(PageLoadedDirection direction)
        {
            base.PageLoaded(direction);

            textBoxLog.Clear();

            var unknownType = false;

            var someHostMayRequireRestart = false; // If a host has restartHost guidance, even if is a live patch,  we want this true (as live patch may fail)

            switch (SelectedUpdateType)
            {
            case UpdateType.NewRetail:
            case UpdateType.Existing:
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, Patch, LivePatchCodesByHost, out someHostMayRequireRestart);
                break;

            case UpdateType.NewSuppPack:
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeSuppPack(SelectedServers, out someHostMayRequireRestart);
                break;

            default:
                unknownType = true;
                break;
            }

            var automaticDisabled = unknownType || (AnyPoolForbidsAutoRestart() && someHostMayRequireRestart);

            AutomaticRadioButton.Enabled = !automaticDisabled;
            AutomaticRadioButton.Checked = !automaticDisabled;
            ManualRadioButton.Checked    = automaticDisabled;

            if (automaticDisabled)
            {
                allowRadioButtonContainer.SetToolTip(Messages.POOL_FORBIDS_AUTOMATIC_RESTARTS);
            }

            if (SelectedUpdateType == UpdateType.NewSuppPack || SelectedServers.Exists(server => !Helpers.ClearwaterOrGreater(server)))
            {
                removeUpdateFileCheckBox.Checked = false;
                removeUpdateFileCheckBox.Visible = false;
            }
        }
Exemple #5
0
        public override void PageLoaded(PageLoadedDirection direction)
        {
            base.PageLoaded(direction);

            textBoxLog.Clear();

            switch (SelectedUpdateType)
            {
            case UpdateType.NewRetail:
            case UpdateType.Existing:
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, Patch);
                if (Helpers.MidnightRideOrGreater(SelectedServers[0].Connection))
                {
                    AutomaticRadioButton.Enabled = true;
                    AutomaticRadioButton.Checked = true;
                }
                else
                {
                    AutomaticRadioButton.Enabled = false;
                    ManualRadioButton.Checked    = true;
                }
                break;

            case UpdateType.NewOem:
                ManualRadioButton.Checked    = true;
                AutomaticRadioButton.Enabled = false;
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeNewOem(SelectedServers);
                break;

            case UpdateType.NewSuppPack:
                AutomaticRadioButton.Enabled = true;
                AutomaticRadioButton.Checked = true;
                textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeSuppPack(SelectedServers);
                break;
            }

            if (SelectedUpdateType == UpdateType.NewSuppPack)
            {
                removeUpdateFileCheckBox.Visible = false;
            }
        }