Merge pull request #1052 from GaborApatiNagy/master_batch_new2

CA-214063: Batch Updates: Name of the master is shown instead of the …
This commit is contained in:
Mihaela Stoica 2016-07-05 11:04:32 +01:00 committed by GitHub
commit 06adea4f47
3 changed files with 40 additions and 9 deletions

View File

@ -167,7 +167,7 @@ namespace XenAdmin.Wizards.PatchingWizard
PatchingWizard_UploadPage.SelectedMasters = PatchingWizard_SelectServers.SelectedMasters;
PatchingWizard_UploadPage.SelectedServers = selectedServers;
PatchingWizard_AutoUpdatingPage.SelectedMasters = PatchingWizard_SelectServers.SelectedMasters;
PatchingWizard_AutoUpdatingPage.SelectedPools = PatchingWizard_SelectServers.SelectedPools;
}
else if (prevPageType == typeof(PatchingWizard_UploadPage))
{

View File

@ -59,7 +59,7 @@ namespace XenAdmin.Wizards.PatchingWizard
public List<Problem> ProblemsResolvedPreCheck { private get; set; }
public List<Host> SelectedMasters { private get; set; }
public List<Pool> SelectedPools { private get; set; }
private List<PoolPatchMapping> patchMappings = new List<PoolPatchMapping>();
public Dictionary<XenServerPatch, string> AllDownloadedPatches = new Dictionary<XenServerPatch, string>();
@ -136,21 +136,23 @@ namespace XenAdmin.Wizards.PatchingWizard
Dictionary<Host, List<PlanAction>> planActionsPerPool = new Dictionary<Host, List<PlanAction>>();
foreach (var master in SelectedMasters)
foreach (var pool in SelectedPools)
{
var master = Helpers.GetMaster(pool.Connection);
Dictionary<Host, List<PlanAction>> planActionsByHost = new Dictionary<Host, List<PlanAction>>();
Dictionary<Host, List<PlanAction>> delayedActionsByHost = new Dictionary<Host, List<PlanAction>>();
planActionsPerPool.Add(master, new List<PlanAction>());
foreach (var host in master.Connection.Cache.Hosts)
foreach (var host in pool.Connection.Cache.Hosts)
{
planActionsByHost.Add(host, new List<PlanAction>());
delayedActionsByHost.Add(host, new List<PlanAction>());
}
var hosts = master.Connection.Cache.Hosts;
var hosts = pool.Connection.Cache.Hosts;
var us = Updates.GetUpgradeSequence(master.Connection);
var us = Updates.GetUpgradeSequence(pool.Connection);
foreach (var patch in us.UniquePatches)
{
@ -288,6 +290,9 @@ namespace XenAdmin.Wizards.PatchingWizard
}
textBoxLog.Text = sb.ToString();
textBoxLog.SelectionStart = textBoxLog.Text.Length;
textBoxLog.ScrollToCaret();
}
private void WorkerDoWork(object sender, DoWorkEventArgs doWorkEventArgs)

View File

@ -96,6 +96,17 @@ namespace XenAdmin.Wizards.PatchingWizard
List<Host> selectedServers = SelectedServers;
dataGridViewHosts.Rows.Clear();
if (IsInAutomaticMode)
{
//hides expand column
dataGridViewHosts.Columns[0].Visible = false;
}
else
{
dataGridViewHosts.Columns[0].Visible = true;
}
List<IXenConnection> xenConnections = ConnectionsManager.XenConnectionsCopy;
xenConnections.Sort();
foreach (IXenConnection xenConnection in xenConnections)
@ -105,9 +116,20 @@ namespace XenAdmin.Wizards.PatchingWizard
if (!xenConnection.IsConnected)
continue;
var host = Helpers.GetMaster(xenConnection);
int index = dataGridViewHosts.Rows.Add(new PatchingHostsDataGridViewRow(host, false));
EnabledRow(host, SelectedUpdateType, index);
var pool = Helpers.GetPoolOfOne(xenConnection);
Host master = pool.Connection.Resolve(pool.master);
int index = -1;
if (Helpers.GetPool(xenConnection) != null) //pools
{
index = dataGridViewHosts.Rows.Add(new PatchingHostsDataGridViewRow(pool));
}
else //standalone hosts
{
index = dataGridViewHosts.Rows.Add(new PatchingHostsDataGridViewRow(master, false));
}
EnabledRow(master, SelectedUpdateType, index);
}
else
{
@ -467,6 +489,10 @@ namespace XenAdmin.Wizards.PatchingWizard
else if ((int)row.Cells[POOL_CHECKBOX_COL].Value != value)
dataGridViewHosts.CheckBoxChange(row.Index, POOL_CHECKBOX_COL);
}
if (IsInAutomaticMode && row.Tag is Pool)
{
dataGridViewHosts.CheckBoxChange(row.Index, POOL_CHECKBOX_COL);
}
}
}