diff --git a/XenAdmin/TabPages/ManageCdnUpdatesPage.cs b/XenAdmin/TabPages/ManageCdnUpdatesPage.cs index d60ac1c65..e829c6979 100644 --- a/XenAdmin/TabPages/ManageCdnUpdatesPage.cs +++ b/XenAdmin/TabPages/ManageCdnUpdatesPage.cs @@ -478,24 +478,39 @@ namespace XenAdmin.TabPages var connection = kvp.Key; var poolUpdateInfo = kvp.Value; - foreach (var hostUpdateInfo in poolUpdateInfo.HostsWithUpdates) + stream.WriteLine(connection.Name); + stream.WriteLine(); + + var hosts = poolUpdateInfo.HostsWithUpdates + .Select(hui => connection.Resolve(new XenRef(hui.HostOpaqueRef))) + .Where(h => h != null).OrderBy(h => h).ToList(); + + foreach (var host in hosts) { - stream.WriteLine(connection.Resolve(new XenRef(hostUpdateInfo.HostOpaqueRef))?.Name()); + var hostUpdateInfo = poolUpdateInfo.HostsWithUpdates.FirstOrDefault(hui => hui.HostOpaqueRef == host.opaque_ref); + if (hostUpdateInfo == null) + continue; + + stream.WriteLine(host.Name()); stream.WriteLine(string.Join("\n", hostUpdateInfo.RecommendedGuidance.Select(Cdn.FriendlyInstruction))); + stream.WriteLine(); var categories = hostUpdateInfo.GetUpdateCategories(poolUpdateInfo); foreach (var category in categories) { stream.WriteLine($"{category.Item1.GetCategoryTitle(category.Item2.Count)}"); + stream.WriteLine(); foreach (var update in category.Item2) { stream.WriteLine(update.Summary); stream.WriteLine(update.CollateDetails()); + stream.WriteLine(); } } stream.WriteLine(string.Join(", ", hostUpdateInfo.Rpms)); + stream.WriteLine(); } } } diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs index 56ef9192b..7cb7be9a3 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_ModePage.cs @@ -316,8 +316,9 @@ namespace XenAdmin.Wizards.PatchingWizard } } - poolDict[pool] = new StringBuilder(string.Join(Environment.NewLine, - hostDict.OrderBy(k => k.Key).Select(k => k.Value.ToString()))); + if (hostDict.Count > 0) + poolDict[pool] = new StringBuilder(string.Join(Environment.NewLine, + hostDict.OrderBy(k => k.Key).Select(k => k.Value.ToString()))); } return poolDict;