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: v17.1.0~696^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b20637714e366b44ec604a76bab9095d5f4a1ef2;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 --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index f8d4398b56f..7297b9dd2e8 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -470,7 +470,7 @@ class CephadmServe: def _refresh_host_devices(self, host: str) -> Optional[str]: 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 50628ca3f78..ba5ebe7cf53 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -1355,10 +1355,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), ]