CP-13041 : Remove the hotfix after installing it.

Signed-off-by: Carmen Agimof <Carmen.Agimof@citrix.com>
This commit is contained in:
Carmen Agimof 2015-07-08 17:35:50 +01:00
parent 66c57c4fce
commit fa61ff27c7
9 changed files with 141 additions and 13 deletions

View File

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

View File

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

View File

@ -139,6 +139,14 @@ namespace XenAdmin.Wizards.PatchingWizard
}
}
public bool RemoveUpdateFile
{
get
{
return removeUpdateFileCheckBox.Checked;
}
}
public List<Host> SelectedServers { private get; set; }
public Pool_patch Patch { private get; set; }
public UpdateType SelectedUpdateType { private get; set; }

View File

@ -166,7 +166,7 @@
<value>15, 3, 3, 3</value>
</data>
<data name="ManualRadioButton.Size" type="System.Drawing.Size, System.Drawing">
<value>545, 34</value>
<value>534, 34</value>
</data>
<data name="ManualRadioButton.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -229,7 +229,7 @@
<value>True</value>
</data>
<data name="textBoxLog.Size" type="System.Drawing.Size, System.Drawing">
<value>557, 143</value>
<value>546, 230</value>
</data>
<data name="textBoxLog.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
@ -244,13 +244,13 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxLog.ZOrder" xml:space="preserve">
<value>5</value>
<value>7</value>
</data>
<data name="button1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="button1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 314</value>
<value>3, 401</value>
</data>
<data name="button1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 10</value>
@ -274,7 +274,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;button1.ZOrder" xml:space="preserve">
<value>6</value>
<value>5</value>
</data>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
@ -292,7 +292,7 @@
<value>3, 3, 3, 15</value>
</data>
<data name="autoHeightLabel1.Size" type="System.Drawing.Size, System.Drawing">
<value>557, 39</value>
<value>546, 39</value>
</data>
<data name="autoHeightLabel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -345,17 +345,47 @@
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="removeUpdateFileCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="removeUpdateFileCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 437</value>
</data>
<data name="removeUpdateFileCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 17</value>
</data>
<data name="removeUpdateFileCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="removeUpdateFileCheckBox.Text" xml:space="preserve">
<value>Allow XenCenter to &amp;delete the update installation file</value>
</data>
<data name="&gt;&gt;removeUpdateFileCheckBox.Name" xml:space="preserve">
<value>removeUpdateFileCheckBox</value>
</data>
<data name="&gt;&gt;removeUpdateFileCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;removeUpdateFileCheckBox.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;removeUpdateFileCheckBox.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="tableLayoutPanel1.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>1, 1</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>7</value>
<value>8</value>
</data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>563, 347</value>
<value>565, 467</value>
</data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -373,16 +403,22 @@
<value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="AutomaticRadioButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="ManualRadioButton" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label2" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="textBoxLog" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="button1" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,40,AutoSize,0,Percent,100,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="autoHeightLabel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="AutomaticRadioButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="ManualRadioButton" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label2" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="button1" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="removeUpdateFileCheckBox" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="textBoxLog" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Absolute,40,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AccessibleName" xml:space="preserve">
<value />
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>563, 347</value>
<value>565, 467</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>PatchingWizard_ModePage</value>

View File

@ -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<Problem> ProblemsResolvedPreCheck { private get; set; }
public Dictionary<Host, VDI> 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));

View File

@ -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<Pool_patch> _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<Pool_patch>(patch);
}
protected override void RunWithSession(ref Session session)
{
XenRef<Task> task = Pool_patch.async_pool_clean(session, _patchRef.opaque_ref);
PollTaskForResultAndDestroy(Connection, ref session, task);
}
}
}

View File

@ -831,6 +831,7 @@
<Compile Include="Wizards\PatchingWizard\PatchingWizard_UploadPage.Designer.cs">
<DependentUpon>PatchingWizard_UploadPage.cs</DependentUpon>
</Compile>
<Compile Include="Wizards\PatchingWizard\PlanActions\RemoveUpdateFile.cs" />
<Compile Include="Wizards\PatchingWizard\PlanActions\InstallSupplementalPackPlanAction.cs" />
<Compile Include="XenSearch\TreeNodeGroupAcceptor.cs">
</Compile>

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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 {
}
}
/// <summary>
/// Looks up a localized string similar to Removing update {0} from {1}... .
/// </summary>
public static string UPDATES_WIZARD_REMOVING_UPDATE {
get {
return ResourceManager.GetString("UPDATES_WIZARD_REMOVING_UPDATE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click here to repair.
/// </summary>

View File

@ -880,7 +880,7 @@
<value>Restart toolstack on '{0}'</value>
</data>
<data name="ACTION_TRANSFER_CALLHOME_SETTINGS" xml:space="preserve">
<value>Transfer Health Check settings</value>
<value>Transfer Health Check settings</value>
</data>
<data name="ACTION_UPDATE_INTEGRATED_GPU_PASSTHROUGH_TITLE" xml:space="preserve">
<value>Updating integrated GPU passthrough on '{0}'</value>
@ -11335,6 +11335,9 @@ Check your settings and try again.</value>
<data name="UPDATES_WIZARD_REBOOTING" xml:space="preserve">
<value>Rebooting {0} ... </value>
</data>
<data name="UPDATES_WIZARD_REMOVING_UPDATE" xml:space="preserve">
<value>Removing update {0} from {1}... </value>
</data>
<data name="UPDATES_WIZARD_REPAIR_SR" xml:space="preserve">
<value>Click here to repair</value>
</data>