Skip to content

Commit

Permalink
Corrections as per code review.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <[email protected]>
  • Loading branch information
kc284 committed Nov 21, 2023
1 parent 53bfc7b commit 8662eb4
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 248 deletions.
3 changes: 1 addition & 2 deletions XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using XenAdmin.Actions;
Expand Down Expand Up @@ -326,7 +325,7 @@ private AsyncAction GetCleanActionForPoolUpdate(Pool_update update)
if (update == null || update.Connection == null || !update.Connection.IsConnected)
return null;

return new DelegatedAsyncAction(update.Connection, Messages.REMOVE_PATCH, "", "", session =>
return new DelegatedAsyncAction(update.Connection, Messages.PATCHINGWIZARD_REMOVE_UPDATE, "", "", session =>
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -194,6 +195,8 @@ private List<HostPlan> CompileManualHostPlan(Pool pool, out List<Host> applicabl

if (SelectedUpdateType == UpdateType.ISO)
{
Debug.Assert(PoolUpdate != null, "PoolUpdate should not be null!");

if (PoolUpdate != null) //ely or greater
{
foreach (var server in SelectedServers)
Expand Down
13 changes: 5 additions & 8 deletions XenModel/Actions/Updates/UploadUpdateAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,11 @@ public class UploadUpdateAction : AsyncAction, IByteProgressAction
public string ByteProgressDescription { get; set; }

private Pool_update poolUpdate;
public Pool_update PoolUpdate
{
get { return poolUpdate; }
}
public Pool_update PoolUpdate => poolUpdate;


public UploadUpdateAction(IXenConnection connection, List<Host> selectedServers, string path, bool suppressHistory)
: base(connection, null, Messages.SUPP_PACK_UPLOADING, suppressHistory)
: base(connection, null, Messages.UPLOAD_UPDATE_UPLOADING, suppressHistory)
{
Host = Helpers.GetCoordinator(connection) ?? throw new NullReferenceException();

Expand Down Expand Up @@ -104,7 +101,7 @@ public override void RecomputeCanCancel()

private string UploadSupplementalPack(SR sr)
{
this.Description = String.Format(Messages.SUPP_PACK_UPLOADING_TO, _updateName, sr.Name());
this.Description = String.Format(Messages.UPLOAD_UPDATE_UPLOADING_TO_SR, _updateName, sr.Name());
log.DebugFormat("Creating vdi of size {0} bytes on SR '{1}'", _totalUpdateSize, sr.Name());

VDI vdi = NewVDI(sr);
Expand Down Expand Up @@ -134,7 +131,7 @@ private string UploadSupplementalPack(SR sr)
HTTP.UpdateProgressDelegate progressDelegate = delegate(int percent)
{
var sr1 = sr;
var descr = string.Format(Messages.UPLOAD_PATCH_UPLOADING_TO_SR_PROGRESS_DESCRIPTION, _updateName, sr1.Name(),
var descr = string.Format(Messages.UPLOAD_UPDATE_UPLOADING_TO_SR_PROGRESS_DESCRIPTION, _updateName, sr1.Name(),
Util.DiskSizeString(percent * _totalUpdateSize / 100, "F1"), Util.DiskSizeString(_totalUpdateSize));

var actionPercent = (int)((totalUploaded * 100 + percent) / totalCount);
Expand Down Expand Up @@ -228,7 +225,7 @@ private string UploadSupplementalPack(SR sr)
VdiRefsPerHost.Add(server, vdiRef);

totalUploaded++;
Description = string.Format(Messages.SUPP_PACK_UPLOADED, sr.Name());
Description = string.Format(Messages.UPLOAD_UPDATE_UPLOADED, sr.Name());

foreach (Host host in servers)
SrsWithUploadedUpdatesPerHost[host] = sr;
Expand Down
195 changes: 20 additions & 175 deletions XenModel/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8662eb4

Please sign in to comment.