From: Adam King Date: Wed, 29 Sep 2021 02:10:07 +0000 (-0400) Subject: mgr/cephadm: use json-pretty for ceph-volume calls X-Git-Tag: v16.2.7~67^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=813d2e34d84a0545ac6a3b82773adba44a5156ee;p=ceph.git mgr/cephadm: use json-pretty for ceph-volume calls To avoid a single line json string that is too long and causes a chunk longer than limit error Fixes: https://tracker.ceph.com/issues/52745 Signed-off-by: Adam King (cherry picked from commit b20637714e366b44ec604a76bab9095d5f4a1ef2) --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index e42087673717..0eed2090f96e 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -441,7 +441,7 @@ class CephadmServe: with_lsm = self.mgr.get_module_option('device_enhanced_scan') inventory_args = ['--', 'inventory', - '--format=json', + '--format=json-pretty', '--filter-for-batch'] if with_lsm: inventory_args.insert(-1, "--with-lsm") diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index 008452a2c4c1..9593a3073eed 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -1431,10 +1431,10 @@ Traceback (most recent call last): assert _run_cephadm.mock_calls == [ mock.call('test', 'osd', 'ceph-volume', - ['--', 'inventory', '--format=json', '--filter-for-batch'], image='', + ['--', 'inventory', '--format=json-pretty', '--filter-for-batch'], image='', no_fsid=False), mock.call('test', 'osd', 'ceph-volume', - ['--', 'inventory', '--format=json'], image='', + ['--', 'inventory', '--format=json-pretty'], image='', no_fsid=False), ]