]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: sort host labels in ceph orch host ls output 66763/head
authorShubha Jain <SHUBHA.JAIN1@ibm.com>
Tue, 30 Dec 2025 11:46:42 +0000 (17:16 +0530)
committerShubha Jain <SHUBHA.JAIN1@ibm.com>
Fri, 17 Apr 2026 11:10:58 +0000 (16:40 +0530)
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 <SHUBHA.JAIN1@ibm.com>
src/pybind/mgr/orchestrator/module.py

index 4b4489237e87f414a966a57e3d9d9e94e03ac76c..83db20187f7b54ee6cf2e80e2b862f2c3a2f2a2e 100644 (file)
@@ -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,