diff --git a/XenAdmin/Diagnostics/Checks/OutOfSyncWithCdnCheck.cs b/XenAdmin/Diagnostics/Checks/OutOfSyncWithCdnCheck.cs index ac008b471..1d396f9f7 100644 --- a/XenAdmin/Diagnostics/Checks/OutOfSyncWithCdnCheck.cs +++ b/XenAdmin/Diagnostics/Checks/OutOfSyncWithCdnCheck.cs @@ -39,6 +39,8 @@ namespace XenAdmin.Diagnostics.Checks { public class OutOfSyncWithCdnCheck : PoolCheck { + private const int DAYS_SINCE_LAST_SYNC = 7; + public OutOfSyncWithCdnCheck(Pool pool) : base (pool) { @@ -53,8 +55,8 @@ namespace XenAdmin.Diagnostics.Checks { if (Helpers.XapiEqualOrGreater_23_18_0(Pool.Connection)) { - if (DateTime.UtcNow - Pool.last_update_sync >= TimeSpan.FromDays(7)) - return new CdnOutOfSyncProblem(this, Pool); + if (DateTime.UtcNow - Pool.last_update_sync >= TimeSpan.FromDays(DAYS_SINCE_LAST_SYNC)) + return new CdnOutOfSyncProblem(this, Pool, DAYS_SINCE_LAST_SYNC); } return null; diff --git a/XenAdmin/Diagnostics/Problems/PoolProblem/CdnOutOfSyncProblem.cs b/XenAdmin/Diagnostics/Problems/PoolProblem/CdnOutOfSyncProblem.cs index 5670a6b5e..1ebc9a053 100644 --- a/XenAdmin/Diagnostics/Problems/PoolProblem/CdnOutOfSyncProblem.cs +++ b/XenAdmin/Diagnostics/Problems/PoolProblem/CdnOutOfSyncProblem.cs @@ -38,12 +38,15 @@ namespace XenAdmin.Diagnostics.Problems.PoolProblem { public class CdnOutOfSyncProblem : PoolProblem { - public CdnOutOfSyncProblem(Check check, Pool pool) + private readonly int _days; + + public CdnOutOfSyncProblem(Check check, Pool pool, int days) : base(check, pool) { + _days = days; } - public override string Description => $"{Pool.Connection.Name}:{string.Format(Messages.ALERT_CDN_OUT_OF_SYNC_TITLE, 7)}"; + public override string Description => $"{Pool.Connection.Name}:{string.Format(Messages.ALERT_CDN_OUT_OF_SYNC_TITLE, _days)}"; public override string HelpMessage => Messages.UPDATES_GENERAL_TAB_SYNC_NOW; diff --git a/XenAdmin/TabPages/CdnUpdates/CdnExpandableRow.cs b/XenAdmin/TabPages/CdnUpdates/CdnExpandableRow.cs index 0d8f20621..0ee1f0e48 100644 --- a/XenAdmin/TabPages/CdnUpdates/CdnExpandableRow.cs +++ b/XenAdmin/TabPages/CdnUpdates/CdnExpandableRow.cs @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -264,7 +265,7 @@ namespace XenAdmin.TabPages.CdnUpdates { var msg = allLivePatches ? Messages.HOTFIX_POST_UPDATE_LIVEPATCH_ACTIONS : Messages.HOTFIX_POST_UPDATE_ACTIONS; - var text = string.Format(msg, string.Join("\n", guidance.Select(Cdn.FriendlyInstruction))); + var text = string.Format(msg, string.Join(Environment.NewLine, guidance.Select(Cdn.FriendlyInstruction))); var img = allLivePatches ? Images.StaticImages.livepatch_16 : Images.StaticImages.rightArrowLong_Blue_16; SetValues(text, img); @@ -276,7 +277,7 @@ namespace XenAdmin.TabPages.CdnUpdates { public RpmsRow(string[] rpms) { - SetValues(string.Join("\n", rpms), null); + SetValues(string.Join(Environment.NewLine, rpms), null); } } }