From: Shubha Jain Date: Tue, 30 Dec 2025 11:46:42 +0000 (+0530) Subject: mgr/orchestrator: sort host labels in ceph orch host ls output X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=01a5ce89bcc115e0bd652b40d130e61360763660;p=ceph.git 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 --- 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,