Exemplo n.º 1
0
        protected override List <HostPlan> GenerateHostPlans(Pool pool, out List <Host> applicableHosts)
        {
            var master      = Helpers.GetMaster(pool);
            var planActions = new List <PlanAction>();

            var alertPatch = SelectedUpdateAlert == null ? null : SelectedUpdateAlert.Patch;

            bool download = alertPatch != null && PatchFromDisk.Key == null &&
                            (!AllDownloadedPatches.ContainsKey(alertPatch) || !File.Exists(AllDownloadedPatches[alertPatch]));

            if (download)
            {
                planActions.Add(new DownloadPatchPlanAction(master.Connection, alertPatch, AllDownloadedPatches, PatchFromDisk));
            }

            var skipDiskSpaceCheck = SelectedUpdateType != UpdateType.Legacy ||
                                     Helpers.ElyOrGreater(master.Connection); //this is superfluous; just added for completeness

            if (alertPatch != null)
            {
                planActions.Add(new UploadPatchToMasterPlanAction(this, master.Connection, alertPatch,
                                                                  PatchMappings, AllDownloadedPatches, PatchFromDisk, skipDiskSpaceCheck));
            }
            else if (!string.IsNullOrEmpty(SelectedPatchFilePath))
            {
                var servers = SelectedServers.Where(s => s.Connection == master.Connection).ToList();
                planActions.Add(new UploadPatchToMasterPlanAction(this, master.Connection, servers, SelectedPatchFilePath,
                                                                  SelectedUpdateType, PatchMappings, skipDiskSpaceCheck));
            }

            var hostPlan = new HostPlan(master, null, planActions, null);

            applicableHosts = new List <Host> {
                master
            };
            return(new List <HostPlan> {
                hostPlan
            });
        }
Exemplo n.º 2
0
 public double DelayedActionsIncrement(HostPlan hp)
 {
     return(hp.DelayedActionsIncrement * HostPlansIncrement);
 }
Exemplo n.º 3
0
 public double UpdatesActionsIncrement(HostPlan hp)
 {
     return(hp.UpdatesActionsIncrement * HostPlansIncrement);
 }
Exemplo n.º 4
0
 public double InitialActionsIncrement(HostPlan hp)
 {
     return(hp.InitialActionsIncrement * HostPlansIncrement);
 }