mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CA-217232: Fixed regression caused by the fix for CA-216935
Changes following the code review
This commit is contained in:
parent
53619c775d
commit
1c5ba794b4
@ -55,7 +55,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
|
||||
{
|
||||
|
||||
var master = Helpers.GetMaster(host.Connection);
|
||||
var mapping = mappings.Find(m => m.XenServerPatch.Uuid == xenServerPatch.Uuid && m.MasterHost.uuid == master.uuid);
|
||||
var mapping = mappings.Find(m => m.XenServerPatch.Equals(xenServerPatch) && m.MasterHost.uuid == master.uuid);
|
||||
|
||||
if (mapping != null && mapping.Pool_patch != null)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
|
||||
protected override void RunWithSession(ref Session session)
|
||||
{
|
||||
var master = Helpers.GetMaster(Connection);
|
||||
var mapping = mappings.Find(m => m.XenServerPatch == patch && m.MasterHost.uuid == master.uuid);
|
||||
var mapping = mappings.Find(m => m.XenServerPatch.Equals(patch) && m.MasterHost.uuid == master.uuid);
|
||||
|
||||
if (mapping != null && mapping.Pool_patch != null)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
|
||||
{
|
||||
Pool_patch poolPatch = null;
|
||||
|
||||
var mapping = patchMappings.FirstOrDefault(pm => pm.MasterHost.uuid == master.uuid && pm.XenServerPatch == patch);
|
||||
var mapping = patchMappings.FirstOrDefault(pm => pm.MasterHost.uuid == master.uuid && pm.XenServerPatch.Equals(patch));
|
||||
|
||||
if (mapping != null || mapping.Pool_patch != null && mapping.Pool_patch.opaque_ref != null)
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
|
||||
|
||||
var newMapping = new PoolPatchMapping(patch, poolPatch, Helpers.GetMaster(session.Connection));
|
||||
|
||||
if (!mappings.Any(m => m.MasterHost.uuid == newMapping.MasterHost.uuid && m.Pool_patch == newMapping.Pool_patch && m.XenServerPatch == patch))
|
||||
if (!mappings.Contains(newMapping))
|
||||
mappings.Add(newMapping);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -92,6 +92,9 @@ namespace XenAdmin.Core
|
||||
|
||||
public bool Equals(XenServerPatch other)
|
||||
{
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return string.Equals(Uuid, other.Uuid, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user