diff --git a/XenAdmin/Alerts/Types/XenServerPatchAlert.cs b/XenAdmin/Alerts/Types/XenServerPatchAlert.cs index 145e02963..555a65fb8 100644 --- a/XenAdmin/Alerts/Types/XenServerPatchAlert.cs +++ b/XenAdmin/Alerts/Types/XenServerPatchAlert.cs @@ -112,7 +112,12 @@ namespace XenAdmin.Alerts public override string Description { - get { return Patch.Description; } + get + { + if (Patch.InstallationSize != 0) + return string.Format(Messages.PATCH_DESCRIPTION_AND_INSTALLATION_SIZE, Patch.Description, Util.DiskSizeString(Patch.InstallationSize)); + return Patch.Description; + } } public override string Name diff --git a/XenAdminTests/UnitTests/AlertTests/XenServerPatchAlertTests.cs b/XenAdminTests/UnitTests/AlertTests/XenServerPatchAlertTests.cs index 03a3243e1..cab1bc9f6 100644 --- a/XenAdminTests/UnitTests/AlertTests/XenServerPatchAlertTests.cs +++ b/XenAdminTests/UnitTests/AlertTests/XenServerPatchAlertTests.cs @@ -52,7 +52,7 @@ namespace XenAdminTests.UnitTests.AlertTests [Test] public void TestAlertWithConnectionAndHosts() { - XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), ""); + XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "", ""); XenServerPatchAlert alert = new XenServerPatchAlert(p); alert.IncludeConnection(connA.Object); alert.IncludeConnection(connB.Object); @@ -80,7 +80,7 @@ namespace XenAdminTests.UnitTests.AlertTests [Test] public void TestAlertWithHostsAndNoConnection() { - XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "1"); + XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "1", ""); XenServerPatchAlert alert = new XenServerPatchAlert(p); alert.IncludeHosts(new List() { hostA.Object, hostB.Object }); @@ -106,7 +106,7 @@ namespace XenAdminTests.UnitTests.AlertTests [Test] public void TestAlertWithConnectionAndNoHosts() { - XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "0"); + XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "0", ""); XenServerPatchAlert alert = new XenServerPatchAlert(p); alert.IncludeConnection(connA.Object); alert.IncludeConnection(connB.Object); @@ -133,7 +133,7 @@ namespace XenAdminTests.UnitTests.AlertTests [Test] public void TestAlertWithNoConnectionAndNoHosts() { - XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "5"); + XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "5", ""); XenServerPatchAlert alert = new XenServerPatchAlert(p); IUnitTestVerifier validator = new VerifyGetters(alert); diff --git a/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs b/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs index 8b910ac06..667744e92 100644 --- a/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs +++ b/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs @@ -135,6 +135,7 @@ namespace XenAdmin.Actions string patchUrl = ""; string timestamp = ""; string priority = ""; + string installationSize = ""; foreach (XmlAttribute attrib in version.Attributes) { @@ -156,13 +157,15 @@ namespace XenAdmin.Actions timestamp = attrib.Value; else if (attrib.Name == "priority") priority = attrib.Value; + else if (attrib.Name == "installation-size") + installationSize = attrib.Value; } var conflictingPatches = GetPatchDependencies(version, ConflictingPatchesNode, ConflictingPatchNode); var requiredPatches = GetPatchDependencies(version, RequiredPatchesNode, RequiredPatchNode); XenServerPatches.Add(new XenServerPatch(uuid, name, description, guidance, patchVersion, url, - patchUrl, timestamp, priority, conflictingPatches, requiredPatches)); + patchUrl, timestamp, priority, installationSize, conflictingPatches, requiredPatches)); } } } diff --git a/XenModel/Actions/Updates/XenServerPatch.cs b/XenModel/Actions/Updates/XenServerPatch.cs index 08b6daa83..638db6a1e 100644 --- a/XenModel/Actions/Updates/XenServerPatch.cs +++ b/XenModel/Actions/Updates/XenServerPatch.cs @@ -45,6 +45,7 @@ namespace XenAdmin.Core public readonly string PatchUrl; public readonly DateTime TimeStamp; public readonly int Priority; + public readonly long InstallationSize; // installation size, in btyes public readonly List ConflictingPatches; public readonly List RequiredPatches; @@ -52,7 +53,7 @@ namespace XenAdmin.Core private const int DEFAULT_PRIORITY = 2; public XenServerPatch(string uuid, string name, string description, string guidance, string version, string url, - string patchUrl, string timestamp, string priority) + string patchUrl, string timestamp, string priority, string installationSize) { _uuid = uuid.ToLowerInvariant(); Name = name; @@ -66,11 +67,13 @@ namespace XenAdmin.Core DateTime.TryParse(timestamp, out TimeStamp); if (!Int32.TryParse(priority, out Priority)) Priority = DEFAULT_PRIORITY; + if (!Int64.TryParse(installationSize, out InstallationSize)) + InstallationSize = 0; } public XenServerPatch(string uuid, string name, string description, string guidance, string version, string url, - string patchUrl, string timestamp, string priority, List conflictingPatches, List requiredPatches) - :this(uuid, name, description, guidance, version, url, patchUrl, timestamp, priority) + string patchUrl, string timestamp, string priority, string installationSize, List conflictingPatches, List requiredPatches) + : this(uuid, name, description, guidance, version, url, patchUrl, timestamp, priority, installationSize) { ConflictingPatches = conflictingPatches; RequiredPatches = requiredPatches; diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index ef35a6d44..99d2a6902 100644 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -24001,6 +24001,16 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to {0} + ///Installation size: {1}. + /// + public static string PATCH_DESCRIPTION_AND_INSTALLATION_SIZE { + get { + return ResourceManager.GetString("PATCH_DESCRIPTION_AND_INSTALLATION_SIZE", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} ///Date modified: {1} diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 783d43144..dc1aa921f 100644 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -8512,6 +8512,10 @@ It is strongly recommended that you Cancel and apply the latest version of the p Update '{0}' Applied to Server '{1}' + + {0} +Installation size: {1} + {0} Date modified: {1}