diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs index e9e462aa0..93d800cc4 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs @@ -157,6 +157,7 @@ namespace XenAdmin.Wizards.PatchingWizard { PatchingWizard_PatchingPage.ManualTextInstructions = PatchingWizard_ModePage.ManualTextInstructions; PatchingWizard_PatchingPage.IsAutomaticMode = PatchingWizard_ModePage.IsAutomaticMode; + PatchingWizard_PatchingPage.RemoveUpdateFile = PatchingWizard_ModePage.RemoveUpdateFile; } else if (prevPageType == typeof(PatchingWizard_PrecheckPage)) { diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.Designer.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.Designer.cs index 09957bacf..ffbfef27c 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.Designer.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.Designer.cs @@ -37,6 +37,7 @@ namespace XenAdmin.Wizards.PatchingWizard this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.autoHeightLabel1 = new XenAdmin.Controls.Common.AutoHeightLabel(); this.label3 = new System.Windows.Forms.Label(); + this.removeUpdateFileCheckBox = new System.Windows.Forms.CheckBox(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -83,8 +84,9 @@ namespace XenAdmin.Wizards.PatchingWizard this.tableLayoutPanel1.Controls.Add(this.AutomaticRadioButton, 0, 2); this.tableLayoutPanel1.Controls.Add(this.ManualRadioButton, 0, 3); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 4); - this.tableLayoutPanel1.Controls.Add(this.textBoxLog, 0, 5); this.tableLayoutPanel1.Controls.Add(this.button1, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.removeUpdateFileCheckBox, 0, 7); + this.tableLayoutPanel1.Controls.Add(this.textBoxLog, 0, 5); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // // autoHeightLabel1 @@ -97,6 +99,14 @@ namespace XenAdmin.Wizards.PatchingWizard resources.ApplyResources(this.label3, "label3"); this.label3.Name = "label3"; // + // removeUpdateFileCheckBox + // + resources.ApplyResources(this.removeUpdateFileCheckBox, "removeUpdateFileCheckBox"); + this.removeUpdateFileCheckBox.Checked = true; + this.removeUpdateFileCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.removeUpdateFileCheckBox.Name = "removeUpdateFileCheckBox"; + this.removeUpdateFileCheckBox.UseVisualStyleBackColor = true; + // // PatchingWizard_ModePage // resources.ApplyResources(this, "$this"); @@ -119,5 +129,6 @@ namespace XenAdmin.Wizards.PatchingWizard private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private XenAdmin.Controls.Common.AutoHeightLabel autoHeightLabel1; private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckBox removeUpdateFileCheckBox; } } diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs index ebd5fae21..900e365ff 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs @@ -139,6 +139,14 @@ namespace XenAdmin.Wizards.PatchingWizard } } + public bool RemoveUpdateFile + { + get + { + return removeUpdateFileCheckBox.Checked; + } + } + public List SelectedServers { private get; set; } public Pool_patch Patch { private get; set; } public UpdateType SelectedUpdateType { private get; set; } diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.resx b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.resx index d9224ea11..a4e287c64 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.resx +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.resx @@ -166,7 +166,7 @@ 15, 3, 3, 3 - 545, 34 + 534, 34 3 @@ -229,7 +229,7 @@ True - 557, 143 + 546, 230 5 @@ -244,13 +244,13 @@ tableLayoutPanel1 - 5 + 7 Bottom, Left - 3, 314 + 3, 401 3, 3, 3, 10 @@ -274,7 +274,7 @@ tableLayoutPanel1 - 6 + 5 1 @@ -292,7 +292,7 @@ 3, 3, 3, 15 - 557, 39 + 546, 39 0 @@ -345,17 +345,47 @@ 1 + + True + + + 3, 437 + + + 270, 17 + + + 7 + + + Allow XenCenter to &delete the update installation file + + + removeUpdateFileCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + Fill 0, 0 + + 1, 1 + - 7 + 8 - 563, 347 + 565, 467 0 @@ -373,16 +403,22 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="AutomaticRadioButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="ManualRadioButton" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxLog" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,40,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="AutomaticRadioButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="ManualRadioButton" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="removeUpdateFileCheckBox" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBoxLog" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,40,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings> True + + + 96, 96 + + True + - 563, 347 + 565, 467 PatchingWizard_ModePage diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PatchingPage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PatchingPage.cs index 8d2d0d90f..fce901ab0 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PatchingPage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PatchingPage.cs @@ -67,6 +67,7 @@ namespace XenAdmin.Wizards.PatchingWizard public Pool_patch Patch { private get; set; } public string ManualTextInstructions { private get; set; } public bool IsAutomaticMode { private get; set; } + public bool RemoveUpdateFile { private get; set; } public string SelectedNewPatch { private get; set; } public List ProblemsResolvedPreCheck { private get; set; } public Dictionary SuppPackVdis { private get; set; } @@ -178,6 +179,10 @@ namespace XenAdmin.Wizards.PatchingWizard } } } + if (RemoveUpdateFile) + { + planActions.Add(new RemoveUpdateFile(pool, poolPatch)); + } } planActions.Add(new UnwindProblemsAction(ProblemsResolvedPreCheck)); diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs new file mode 100644 index 000000000..f7bbafa6b --- /dev/null +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs @@ -0,0 +1,54 @@ +/* Copyright (c) Citrix Systems Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +using XenAPI; + +namespace XenAdmin.Wizards.PatchingWizard.PlanActions +{ + class RemoveUpdateFile : PlanActionWithSession + { + private readonly XenRef _patchRef; + + public RemoveUpdateFile(Pool pool, Pool_patch patch) + : base(pool.Connection, string.Format(Messages.UPDATES_WIZARD_REMOVING_UPDATE, patch.Name, pool.Name)) + { + this._patchRef = new XenRef(patch); + } + + protected override void RunWithSession(ref Session session) + { + + XenRef task = Pool_patch.async_pool_clean(session, _patchRef.opaque_ref); + + PollTaskForResultAndDestroy(Connection, ref session, task); + } + } +} diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index fbc7ffac8..b7458dca0 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -831,6 +831,7 @@ PatchingWizard_UploadPage.cs + diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 0f2235ec0..0b307416e 100644 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -32805,6 +32805,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Removing update {0} from {1}... . + /// + public static string UPDATES_WIZARD_REMOVING_UPDATE { + get { + return ResourceManager.GetString("UPDATES_WIZARD_REMOVING_UPDATE", resourceCulture); + } + } + /// /// Looks up a localized string similar to Click here to repair. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index bf0c1cfee..f69d1dd3b 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -880,7 +880,7 @@ Restart toolstack on '{0}' - Transfer Health Check settings + Transfer Health Check settings Updating integrated GPU passthrough on '{0}' @@ -11335,6 +11335,9 @@ Check your settings and try again. Rebooting {0} ... + + Removing update {0} from {1}... + Click here to repair