Ejemplo n.º 1
0
        public DRFailoverWizard(Pool pool, DRWizardType wizardType)
            : base(pool.Connection)
        {
            InitializeComponent();

            RBACWarningPage                 = new RBACWarningPage();
            DRFailoverWizardFirstPage       = new DRFailoverWizardFirstPage();
            DRFailoverWizardStoragePage1    = new DRFailoverWizardStoragePage();
            DRFailoverWizardPrecheckPage1   = new DRFailoverWizardPrecheckPage();
            DRFailoverWizardRecoverPage1    = new DRFailoverWizardRecoverPage();
            DRFailoverWizardAppliancesPage1 = new DRFailoverWizardAppliancesPage();
            DRFailoverWizardWelcomePage     = new DRFailoverWizardWelcomePage();
            DRFailoverWizardReportPage1     = new DRFailoverWizardReportPage();

            Pool       = pool;
            WizardType = wizardType;

            #region RBAC Warning Page Checks
            if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE)
            {
            }
            else
            {
                RBACWarningPage.WizardPermissionCheck check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_DR_WIZARD_MESSAGE);
                check.AddApiCheck("DR_task.async_create");
                check.Blocking = true;
                RBACWarningPage.AddPermissionChecks(xenConnection, check);
                AddPage(RBACWarningPage, 0);
            }
            #endregion

            DRFailoverWizardReportPage1.SummaryRetreiver = GetSummaryReport;

            DRFailoverWizardWelcomePage.WizardTypeChanged += DRFailoverWizardWelcomePage_WizardTypeChanged;
            DRFailoverWizardWelcomePage.SetWizardType(wizardType);

            DRFailoverWizardRecoverPage1.ReportStarted         += DRFailoverWizardRecoverPage1_ReportStarted;
            DRFailoverWizardRecoverPage1.ReportLineGot         += DRFailoverWizardRecoverPage1_ReportLineGot;
            DRFailoverWizardRecoverPage1.ReportActionResultGot += DRFailoverWizardRecoverPage1_ReportActionResultGot;

            DRFailoverWizardAppliancesPage1.Pool = pool;
            DRFailoverWizardPrecheckPage1.Pool   = pool;

            DRFailoverWizardStoragePage1.NewDrTaskIntroduced += NewDrTaskIntroduced;

            DRFailoverWizardPrecheckPage1.NewDrTaskIntroduced += NewDrTaskIntroduced;
            DRFailoverWizardPrecheckPage1.SrIntroduced        += DRFailoverWizardPrecheckPage1_SrIntroduced;

            AddPages(DRFailoverWizardWelcomePage, DRFailoverWizardFirstPage, DRFailoverWizardStoragePage1, DRFailoverWizardAppliancesPage1,
                     DRFailoverWizardPrecheckPage1, DRFailoverWizardRecoverPage1, DRFailoverWizardReportPage1);
        }
Ejemplo n.º 2
0
        public DRFailoverWizard(Pool pool, DRWizardType wizardType)
            : base(pool.Connection)
        {
            InitializeComponent();

            RBACWarningPage = new RBACWarningPage();
            DRFailoverWizardFirstPage = new DRFailoverWizardFirstPage();
            DRFailoverWizardStoragePage1 = new DRFailoverWizardStoragePage();
            DRFailoverWizardPrecheckPage1 = new DRFailoverWizardPrecheckPage();
            DRFailoverWizardRecoverPage1 = new DRFailoverWizardRecoverPage();
            DRFailoverWizardAppliancesPage1 = new DRFailoverWizardAppliancesPage();
            DRFailoverWizardWelcomePage = new DRFailoverWizardWelcomePage();
            DRFailoverWizardReportPage1 = new DRFailoverWizardReportPage();

            Pool = pool;
            WizardType = wizardType; 

            #region RBAC Warning Page Checks
            if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE)
            {
            }
            else
            {
                RBACWarningPage.WizardPermissionCheck check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_DR_WIZARD_MESSAGE);
                check.AddApiCheck("DR_task.async_create");
                check.Blocking = true;
                RBACWarningPage.AddPermissionChecks(xenConnection, check);
                AddPage(RBACWarningPage, 0);
            }
            #endregion

            DRFailoverWizardReportPage1.SummaryRetreiver = GetSummaryReport;

            DRFailoverWizardWelcomePage.WizardTypeChanged += DRFailoverWizardWelcomePage_WizardTypeChanged;
            DRFailoverWizardWelcomePage.SetWizardType(wizardType);

            DRFailoverWizardRecoverPage1.ReportStarted += DRFailoverWizardRecoverPage1_ReportStarted;
            DRFailoverWizardRecoverPage1.ReportLineGot += DRFailoverWizardRecoverPage1_ReportLineGot;
            DRFailoverWizardRecoverPage1.ReportActionResultGot += DRFailoverWizardRecoverPage1_ReportActionResultGot;

            DRFailoverWizardAppliancesPage1.Pool = pool;
            DRFailoverWizardPrecheckPage1.Pool = pool;

            DRFailoverWizardStoragePage1.NewDrTaskIntroduced += NewDrTaskIntroduced;
            
            DRFailoverWizardPrecheckPage1.NewDrTaskIntroduced += NewDrTaskIntroduced;
            DRFailoverWizardPrecheckPage1.SrIntroduced += DRFailoverWizardPrecheckPage1_SrIntroduced;

            AddPages(DRFailoverWizardWelcomePage, DRFailoverWizardFirstPage, DRFailoverWizardStoragePage1, DRFailoverWizardAppliancesPage1,
                     DRFailoverWizardPrecheckPage1, DRFailoverWizardRecoverPage1, DRFailoverWizardReportPage1);
        }