]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix osd size reported in 'orch ls'
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 22 Sep 2021 07:35:54 +0000 (09:35 +0200)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 2 Nov 2021 09:01:21 +0000 (10:01 +0100)
The current code enforces ('running osds' + 1), see [1].
Let's simply print the number of running osds instead of a
meaningless calculation.

[1] https://github.com/ceph/ceph/commit/1c0a0a6f6153dc555085f263f161666cd171964a#diff-4f2fb7d330e74b64ac41457b7c7a723cd78db86433e0b0c398874531e5a7e39eR1852-R1859

Fixes: https://tracker.ceph.com/issues/50928
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 97219591dab8f54f239ccfb1891c45b01e7bec79)

src/pybind/mgr/orchestrator/module.py

index 741c68d89938154040a58c68986a22f544590ff5..8b194b8a00d9da6e59ea2fda335d4a7d5705d53a 100644 (file)
@@ -604,10 +604,15 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
                 else:
                     refreshed = nice_delta(now, s.last_refresh, ' ago')
 
+                if s.spec.service_type == 'osd':
+                    running = str(s.running)
+                else:
+                    running = '{}/{}'.format(s.running, s.size)
+
                 table.add_row((
                     s.spec.service_name(),
                     s.get_port_summary(),
-                    '%d/%d' % (s.running, s.size),
+                    running,
                     refreshed,
                     nice_delta(now, s.created),
                     pl,