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-Tag: v21.0.1~504^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F66763%2Fhead;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 4b4489237e8..83db20187f7 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,