Ejemplo n.º 1
0
 public DataGridViewRowUpgrade(UnwindProblemsAction action)
     : this()
 {
     RevertAction   = action;
     taskCell.Value = Messages.REVERT_PRECHECK_ACTIONS;
     UpdateStatus(HostUpgradeState.NotUpgraded, Messages.NOT_UPGRADED);
 }
Ejemplo n.º 2
0
        public override void PageLoaded(PageLoadedDirection direction)
        {
            base.PageLoaded(direction);
            UpgradeStatus = RollingUpgradeStatus.NotStarted;
            ImageAnimator.Animate(animatedImage, onFrameChanged);
            if (direction == PageLoadedDirection.Forward && planActions.Count > 0)
            {
                return;
            }

            OnPageUpdated();

            dataGridView1.Rows.Clear();
            UnregisterAllStatusUpdateActions();
            planActions.Clear();

            //Add masters first
            var hostNeedUpgrade = new List <Host>();

            //Add rest of slaves not ugpraded
            foreach (var host in SelectedMasters)
            {
                Pool pool = Helpers.GetPoolOfOne(host.Connection);
                if (pool != null)
                {
                    hostNeedUpgrade.AddRange(pool.HostsToUpgrade());
                }
                else
                {
                    hostNeedUpgrade.Add(host);
                }
            }

            foreach (var host in hostNeedUpgrade)
            {
                planActions.Add(host, GetSubTasksFor(host));
                dataGridView1.Rows.Add(new DataGridViewRowUpgrade(host));
            }

            //Revert precheck changes
            revertAction = new UnwindProblemsAction(ProblemsResolvedPreCheck);
            dataGridView1.Rows.Add(new DataGridViewRowUpgrade(revertAction));

            labelOverallProgress.Text = string.Format(Messages.OVERALL_PROGRESS, 0, dataGridView1.Rows.Count - 1);
            RegisterStatusUpdateActions();
            StartUpgrade();
        }