]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
library: do not always add --yes in batch mode v4.0.50
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Feb 2021 14:28:08 +0000 (15:28 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 11 Mar 2021 12:53:06 +0000 (13:53 +0100)
When asking `ceph-volume` to report only in `lvm batch` context, there's
a bug described in bz1896803 [1] when `--yes` is passed (which by the
way isn't necessary with `--report`).
This commit ensure `--yes` isn't passed to `ceph-volume` when `--report`
is used.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1896803

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1896803
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit fe6d6ba62248853dabf9ecbd5fe702b319b8f14a)

library/ceph_volume.py

index 4224fb5b514c754cf7d0efb516d51235d7b0aeb1..81a782631e7ec91132265da5fc5acfa2aa614905 100644 (file)
@@ -275,7 +275,7 @@ def get_wal(wal, wal_vg):
     return wal
 
 
-def batch(module, container_image):
+def batch(module, container_image, report=None):
     '''
     Batch prepare OSD devices
     '''
@@ -305,7 +305,8 @@ def batch(module, container_image):
     action = ['lvm', 'batch']
     cmd = build_cmd(action, container_image, cluster)
     cmd.extend(['--%s' % objectstore])
-    cmd.append('--yes')
+    if not report:
+        cmd.append('--yes')
 
     if container_image:
         cmd.append('--prepare')
@@ -666,7 +667,7 @@ def run_module():
             '--format=json',
         ]
 
-        cmd = batch(module, container_image)
+        cmd = batch(module, container_image, report=True)
         batch_report_cmd = copy.copy(cmd)
         batch_report_cmd.extend(report_flags)