mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 14:27:26 +01:00
CP-13038: Takes care of the case when the user downloads multiple files(by going back in the wizard and selecting a different update). When clicking cancel or when the install is finished, all the downloaded files are removed.
This commit is contained in:
parent
149e6f8c1e
commit
3f7fd89f87
@ -250,10 +250,7 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
RunMultipleActions(Messages.REVERT_WIZARD_CHANGES, Messages.REVERTING_WIZARD_CHANGES,
|
||||
Messages.REVERTED_WIZARD_CHANGES, subActions);
|
||||
|
||||
if (PatchingWizard_SelectPatchPage.SelectedUpdateAlert != null && PatchingWizard_UploadPage.SelectedNewPatch != null)
|
||||
{
|
||||
File.Delete(PatchingWizard_UploadPage.SelectedNewPatch);
|
||||
}
|
||||
RemoveDownloadedPatches();
|
||||
|
||||
base.OnCancel();
|
||||
}
|
||||
@ -270,6 +267,14 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
RunMultipleActions(Messages.REMOVE_UPDATES, Messages.REMOVING_UPDATES, Messages.REMOVED_UPDATES, subActions);
|
||||
}
|
||||
|
||||
private void RemoveDownloadedPatches()
|
||||
{
|
||||
foreach (string downloadedPatch in PatchingWizard_UploadPage.AllDownloadedPatches)
|
||||
{
|
||||
File.Delete(downloadedPatch);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void FinishWizard()
|
||||
{
|
||||
if (PatchingWizard_UploadPage.NewUploadedPatches != null)
|
||||
@ -284,10 +289,7 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
if (PatchingWizard_UploadPage.AllCreatedSuppPackVdis != null)
|
||||
RemoveTemporaryVdis();
|
||||
|
||||
if (PatchingWizard_SelectPatchPage.SelectedUpdateAlert != null)
|
||||
{
|
||||
File.Delete(PatchingWizard_UploadPage.SelectedNewPatch);
|
||||
}
|
||||
RemoveDownloadedPatches();
|
||||
|
||||
base.FinishWizard();
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
get { return _patch; }
|
||||
}
|
||||
|
||||
public List<string> AllDownloadedPatches = new List<string>();
|
||||
public readonly List<VDI> AllCreatedSuppPackVdis = new List<VDI>();
|
||||
public Dictionary<Host, VDI> SuppPackVdis = new Dictionary<Host, VDI>();
|
||||
|
||||
@ -367,6 +368,7 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
if (action is DownloadAndUnzipXenServerPatchAction)
|
||||
{
|
||||
SelectedNewPatch = ((DownloadAndUnzipXenServerPatchAction)action).PatchPath;
|
||||
AllDownloadedPatches.Add(SelectedNewPatch);
|
||||
PrepareUploadActions();
|
||||
TryUploading();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user