CA-217232: Fixed regression caused by the fix for CA-216935

Changes following the code review
This commit is contained in:
Gabor Apati-Nagy 2016-08-18 16:00:50 +01:00
parent 53619c775d
commit 1c5ba794b4
5 changed files with 7 additions and 4 deletions

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)

View File

@ -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);
}