Improved exported updates output and manual post-update instructions.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-08-08 16:21:00 +01:00
parent c5534c8adf
commit 9d8805f060
2 changed files with 20 additions and 4 deletions

View File

@ -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<Host>(hui.HostOpaqueRef)))
.Where(h => h != null).OrderBy(h => h).ToList();
foreach (var host in hosts)
{
stream.WriteLine(connection.Resolve(new XenRef<Host>(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();
}
}
}

View File

@ -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;