From: Kamoltat Date: Tue, 19 Dec 2023 20:21:50 +0000 (+0000) Subject: src/pybind/mgr/pg_autoscaler/module.py: fix 'pg_autoscale_mode' output X-Git-Tag: testing/wip-jcollin-testing-20250820.041311-squid~45^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d195043317cb10ef34d5252797b046812ff02721;p=ceph-ci.git src/pybind/mgr/pg_autoscaler/module.py: fix 'pg_autoscale_mode' output Problem: `ceph osd pool autoscale-status -f json` and `ceph osd pool autoscale-status` shows discrepeencies between each other in the `pg_autoscale_mode` section, when `no_autoscale` flag is set. Solution: set `pg_autoscale_mode` to `false` for both `ceph osd pool autoscale-status` and the json version of the command if `no_autoscale` is set. Fixes: https://tracker.ceph.com/issues/63860 Signed-off-by: Kamoltat (cherry picked from commit bd8d7e9695644fe4a7f178172eb42a0b5602f458) --- diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index 0ab26387790..451bcf8568c 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -231,7 +231,7 @@ class PgAutoscaler(MgrModule): p['pg_num_target'], # p['pg_num_ideal'], final, - 'off' if self.has_noautoscale_flag() else p['pg_autoscale_mode'], + str(p['pg_autoscale_mode']), str(p['bulk']) ]) return 0, table.get_string(), '' @@ -670,6 +670,11 @@ class PgAutoscaler(MgrModule): ret, _, _ = self._get_pool_pg_targets(osdmap, even_pools, crush_map, root_map, pool_stats, ret, threshold, 'third', overlapped_roots) + # If noautoscale flag is set, we set pg_autoscale_mode to off + if self.has_noautoscale_flag(): + for p in ret: + p['pg_autoscale_mode'] = 'off' + return (ret, root_map) def _get_pool_by_id(self,