]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-volume.py: add support for batch refactored code
authorJan Fajerski <jfajerski@suse.com>
Fri, 26 Jun 2020 08:29:24 +0000 (10:29 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 20 Jul 2020 19:22:38 +0000 (21:22 +0200)
See https://github.com/ceph/ceph/pull/34740 for the batch changes.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit d90834b77f31f186ab72f41680c1f15357b7cdba)

library/ceph_volume.py

index 078a887227b9e05792d884cdf98f1c15410aa0ce..a3eb630b23b2f3b1788c43e4b2064916e5edcbfc 100644 (file)
@@ -703,10 +703,17 @@ def run_module():
             module.fail_json(msg='non-zero return code', **result)
 
         if not report:
-            # if not asking for a report, let's just run the batch command
-            changed = report_result['changed']
-            if changed:
-                # Batch prepare the OSD
+            if 'changed' in report_result:
+                # we have the old batch implementation
+                # if not asking for a report, let's just run the batch command
+                changed = report_result['changed']
+                if changed:
+                    # Batch prepare the OSD
+                    rc, cmd, out, err = exec_command(
+                        module, batch(module, container_image))
+            else:
+                # we have the refactored batch, its idempotent so lets just
+                # run it
                 rc, cmd, out, err = exec_command(
                     module, batch(module, container_image))
         else: