]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use json-pretty for ceph-volume calls 43339/head
authorAdam King <adking@redhat.com>
Wed, 29 Sep 2021 02:10:07 +0000 (22:10 -0400)
committerAdam King <adking@redhat.com>
Wed, 29 Sep 2021 03:05:42 +0000 (23:05 -0400)
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 <adking@redhat.com>
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_cephadm.py

index f8d4398b56f6b379082d8f517d18ed6fb6af33dd..7297b9dd2e879bb5f24e0136b3d4bce211f764b4 100644 (file)
@@ -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")
index 50628ca3f78b9fe819b39663beb94864dd5feeb0..ba5ebe7cf539c301080fa856e6890f60af559aa8 100644 (file)
@@ -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),
             ]