From 01a5ce89bcc115e0bd652b40d130e61360763660 Mon Sep 17 00:00:00 2001 From: Shubha Jain Date: Tue, 30 Dec 2025 17:16:42 +0530 Subject: [PATCH] mgr/orchestrator: sort host labels in ceph orch host ls output Sort host labels alphabetically to improve readability and consistency across hosts. This matches the behavior of structured formats such as yaml. Fixes: https://tracker.ceph.com/issues/74290 Signed-off-by: Shubha Jain --- src/pybind/mgr/orchestrator/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 4b4489237e87..83db20187f7b 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -761,7 +761,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule): table.right_padding_width = 2 for host in natsorted(hosts, key=lambda h: h.hostname): row = (host.hostname, host.addr, ','.join( - host.labels), host.status.capitalize()) + sorted(host.labels)), host.status.capitalize()) if show_detail and isinstance(host, HostDetails): row += (host.server, host.cpu_summary, host.ram, -- 2.47.3