CP-21178: Extend metadata on XenServerVersion

Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
This commit is contained in:
Gabor Apati-Nagy 2017-03-17 10:57:43 +00:00
parent 3bb3f558c0
commit e97fbc8f2e
2 changed files with 15 additions and 3 deletions

View File

@ -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<XenServerPatch> patches = new List<XenServerPatch>();
@ -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));
}
}
}

View File

@ -45,6 +45,7 @@ namespace XenAdmin.Core
public string Url;
public string Oem;
public List<XenServerPatch> Patches;
public string PatchUuid;
/// <summary>
/// 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
/// <param name="minimumPatches">can be null (see <paramref name="MinimalPatches"/></param>
/// <param name="timestamp"></param>
/// <param name="buildNumber"></param>
/// <param name="patch-uuid"></param>
public XenServerVersion(string version_oem, string name, bool latest, bool latestCr, string url, List<XenServerPatch> patches, List<XenServerPatch> 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);
}
}
}
}