CP-18013: [XenCenter] Update host updates pane

For servers running Ely or greater we now produce messages for patching requiring reboot using the host.patches_requiring_reboot field. The Pool_patch objects resolved are sufficient to produce the same messages. Note that some patches produce a message in the old API but not the new, this is intentional. Still to do: update pool updates in the same way,

Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
This commit is contained in:
Callum McIntyre 2016-08-17 09:29:39 +01:00
parent 177ae6acee
commit dffd7507cc

View File

@ -663,14 +663,35 @@ namespace XenAdmin.TabPages
PDSection s = pdSectionUpdates;
List<KeyValuePair<String, String>> messages = CheckServerUpdates(host);
if (messages.Count > 0)
if (Helpers.ElyOrGreater(host))
{
foreach (KeyValuePair<String, String> kvp in messages)
// As of Ely we use host.patches_requiring_reboot to generate the list of reboot required messages
var patchRefs = host.patches_requiring_reboot;
foreach (var patchRef in patchRefs)
{
s.AddEntry(kvp.Key, kvp.Value);
var patch = host.Connection.Resolve(patchRef);
var key = patch.NameWithLocation;
var value = string.Format(
Messages.GENERAL_PANEL_UPDATE_WARNING,
patch.Connection.FriendlyName,
patch.Name);
s.AddEntry(key, value);
}
}
else
{
// For older versions no change to how messages are generated
List<KeyValuePair<String, String>> messages = CheckServerUpdates(host);
if (messages.Count > 0)
{
foreach (KeyValuePair<String, String> kvp in messages)
{
s.AddEntry(kvp.Key, kvp.Value);
}
}
}
if (hostAppliedPatches(host) != "")
{
s.AddEntry(FriendlyName("Pool_patch.applied"), hostAppliedPatches(host));