mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CA-239951 - Patching wizard allows selection of unreachable hosts
Disabled the ability to select unreachable hosts and in addition added a try/catch block to hide error message resulting from trying to clean up an unreachable host. Signed-off-by: Letsibogo Ramadi <letsibogo.ramadi@citrix.com>
This commit is contained in:
parent
b14cc05968
commit
045c405f92
@ -208,6 +208,14 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
return;
|
||||
}
|
||||
|
||||
//if host is unreachable
|
||||
if (!host.IsLive)
|
||||
{
|
||||
row.Enabled = false;
|
||||
row.Cells[3].ToolTipText = Messages.PATCHINGWIZARD_SELECTSERVERPAGE_HOST_UNREACHABLE;
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -228,6 +236,13 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
return;
|
||||
}
|
||||
|
||||
if (!host.IsLive)
|
||||
{
|
||||
row.Enabled = false;
|
||||
row.Cells[3].ToolTipText = Messages.PATCHINGWIZARD_SELECTSERVERPAGE_HOST_UNREACHABLE;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case UpdateType.NewRetail:
|
||||
@ -430,14 +445,18 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
{
|
||||
if (poolSelectionOnly)
|
||||
{
|
||||
return SelectedPools.SelectMany(p => p.Connection.Cache.Hosts).ToList();
|
||||
if (IsInAutomaticMode)
|
||||
//prechecks will fail in automated updates mode if one of the hosts is unreachable
|
||||
return SelectedPools.SelectMany(p => p.Connection.Cache.Hosts).ToList();
|
||||
//prechecks will issue warning but allow updates to be installed on the reachable hosts only
|
||||
return SelectedPools.SelectMany(p => p.Connection.Cache.Hosts.Where(host => host.IsLive)).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Host> hosts = new List<Host>();
|
||||
foreach (PatchingHostsDataGridViewRow row in dataGridViewHosts.Rows)
|
||||
{
|
||||
if (row.Tag is Host)
|
||||
if (row.IsSelectableHost)
|
||||
{
|
||||
if ((row.HasPool && ((int)row.Cells[POOL_ICON_HOST_CHECKBOX_COL].Value) == CHECKED) || (!row.HasPool && ((int)row.Cells[POOL_CHECKBOX_COL].Value) == CHECKED))
|
||||
hosts.Add((Host)row.Tag);
|
||||
|
@ -61,9 +61,15 @@ namespace XenAdmin.Actions
|
||||
protected override void Run()
|
||||
{
|
||||
Description = String.Format(Messages.REMOVING_UPDATE, patch.Name);
|
||||
|
||||
RelatedTask=Pool_patch.async_destroy(Session, patch.opaque_ref);
|
||||
PollToCompletion(0, 100);
|
||||
try
|
||||
{
|
||||
RelatedTask = Pool_patch.async_destroy(Session, patch.opaque_ref);
|
||||
PollToCompletion(0, 100);
|
||||
}
|
||||
catch (Failure f)
|
||||
{
|
||||
log.Error("Clean up failed", f);
|
||||
}
|
||||
|
||||
Description = String.Format(Messages.REMOVED_UPDATE, patch.Name);
|
||||
}
|
||||
|
9
XenModel/Messages.Designer.cs
generated
9
XenModel/Messages.Designer.cs
generated
@ -26889,6 +26889,15 @@ namespace XenAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The server is unreachable.
|
||||
/// </summary>
|
||||
public static string PATCHINGWIZARD_SELECTSERVERPAGE_HOST_UNREACHABLE {
|
||||
get {
|
||||
return ResourceManager.GetString("PATCHINGWIZARD_SELECTSERVERPAGE_HOST_UNREACHABLE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update already applied.
|
||||
/// </summary>
|
||||
|
@ -9286,6 +9286,9 @@ However, there is not enough space to perform the repartitioning, so the current
|
||||
<data name="PATCHINGWIZARD_SELECTSERVERPAGE_HOST_UNLICENSED_FOR_AUTOMATED_UPDATES" xml:space="preserve">
|
||||
<value>The server is not licensed for automated updates</value>
|
||||
</data>
|
||||
<data name="PATCHINGWIZARD_SELECTSERVERPAGE_HOST_UNREACHABLE" xml:space="preserve">
|
||||
<value>The server is unreachable</value>
|
||||
</data>
|
||||
<data name="PATCHINGWIZARD_SELECTSERVERPAGE_PATCH_ALREADY_APPLIED" xml:space="preserve">
|
||||
<value>Update already applied</value>
|
||||
</data>
|
||||
|
Loading…
Reference in New Issue
Block a user