Commit 21674464 authored by Iustin Pop's avatar Iustin Pop
Browse files

Sort OS names and variants in LUDiagnoseOS

The OS list and variants as returned from LUDiagnoseOS is not sorted,
and gnt-instance reinstall doesn't sort it either. This means that it
the menu that users are present with is inconsistent across clusters,
and that is confusing.

To make this consistent across all users of the LU, we sort the names in
the LU itself.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent e1df06f2
......@@ -3194,7 +3194,8 @@ class LUDiagnoseOS(NoHooksLU):
output = []
cluster = self.cfg.GetClusterInfo()
for os_name, os_data in pol.items():
for os_name in utils.NiceSort(pol.keys()):
os_data = pol[os_name]
row = []
valid = True
(variants, params, api_versions) = null_state = (set(), set(), set())
......@@ -3231,7 +3232,7 @@ class LUDiagnoseOS(NoHooksLU):
for node_name, nos_list in os_data.items():
val[node_name] = nos_list
elif field == "variants":
val = list(variants)
val = utils.NiceSort(list(variants))
elif field == "parameters":
val = list(params)
elif field == "api_versions":
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment