From e97fbc8f2e475e17d07056ac156c689cd88931a0 Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Fri, 17 Mar 2017 10:57:43 +0000 Subject: [PATCH] CP-21178: Extend metadata on XenServerVersion Signed-off-by: Gabor Apati-Nagy --- .../Actions/Updates/DownloadUpdatesXmlAction.cs | 5 ++++- XenModel/Actions/Updates/XenServerVersion.cs | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs b/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs index 72892ca8a..1bcd9139f 100644 --- a/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs +++ b/XenModel/Actions/Updates/DownloadUpdatesXmlAction.cs @@ -237,6 +237,7 @@ namespace XenAdmin.Actions string url = ""; string timestamp = ""; string buildNumber = ""; + string patchUuid = ""; foreach (XmlAttribute attrib in version.Attributes) { @@ -254,6 +255,8 @@ namespace XenAdmin.Actions timestamp = attrib.Value; else if (attrib.Name == "build-number") buildNumber = attrib.Value; + else if (attrib.Name == "patch-uuid") + patchUuid = attrib.Value; } List patches = new List(); @@ -289,7 +292,7 @@ namespace XenAdmin.Actions } XenServerVersions.Add(new XenServerVersion(version_oem, name, is_latest, is_latest_cr, url, patches, minimalPatches, timestamp, - buildNumber)); + buildNumber, patchUuid)); } } } diff --git a/XenModel/Actions/Updates/XenServerVersion.cs b/XenModel/Actions/Updates/XenServerVersion.cs index dff2954fd..edbf75b78 100644 --- a/XenModel/Actions/Updates/XenServerVersion.cs +++ b/XenModel/Actions/Updates/XenServerVersion.cs @@ -45,6 +45,7 @@ namespace XenAdmin.Core public string Url; public string Oem; public List Patches; + public string PatchUuid; /// /// A host of this version is considered up-to-date when it has all the patches in this list installed on it @@ -68,8 +69,9 @@ namespace XenAdmin.Core /// can be null (see /// /// + /// public XenServerVersion(string version_oem, string name, bool latest, bool latestCr, string url, List patches, List minimumPatches, - string timestamp, string buildNumber) + string timestamp, string buildNumber, string patchUuid) { ParseVersion(version_oem); Name = name; @@ -82,6 +84,7 @@ namespace XenAdmin.Core MinimalPatches = minimumPatches; DateTime.TryParse(timestamp, out TimeStamp); BuildNumber = buildNumber; + PatchUuid = patchUuid; } private void ParseVersion(string version_oem) @@ -109,7 +112,13 @@ namespace XenAdmin.Core } } - + public bool IsVersionAvailableAsAnUpdate + { + get + { + return string.IsNullOrEmpty(PatchUuid); + } + } } } \ No newline at end of file