mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
Merge pull request #1271 from mcintyre94/CA-228723
[CA-228723] Cancelling update installation leaves the update in xapi db
This commit is contained in:
commit
30a5f36515
@ -380,16 +380,28 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
{
|
||||
if (PatchingWizard_UploadPage.AllIntroducedPoolUpdates != null && PatchingWizard_UploadPage.AllIntroducedPoolUpdates.Count > 0)
|
||||
{
|
||||
return PatchingWizard_UploadPage.AllIntroducedPoolUpdates.Select(pu => GetCleanUpPoolUpdateAction(pu)).ToList();
|
||||
return PatchingWizard_UploadPage.AllIntroducedPoolUpdates.Select(GetCleanUpPoolUpdateAction).ToList();
|
||||
}
|
||||
|
||||
return new List<AsyncAction>();
|
||||
}
|
||||
|
||||
private AsyncAction GetCleanUpPoolUpdateAction(Pool_update poolUpdate)
|
||||
private static AsyncAction GetCleanUpPoolUpdateAction(Pool_update poolUpdate)
|
||||
{
|
||||
return
|
||||
new DelegatedAsyncAction(poolUpdate.Connection, Messages.REMOVE_PATCH, "", "", session => Pool_update.pool_clean(session, poolUpdate.opaque_ref));
|
||||
new DelegatedAsyncAction(poolUpdate.Connection, Messages.REMOVE_PATCH, "", "", session =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Pool_update.pool_clean(session, poolUpdate.opaque_ref);
|
||||
if(!poolUpdate.AppliedOnHosts.Any())
|
||||
Pool_update.destroy(session, poolUpdate.opaque_ref);
|
||||
}
|
||||
catch (Failure f)
|
||||
{
|
||||
log.Error("Clean up failed", f);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user