From: Jason Dillaman Date: Mon, 11 May 2020 23:55:50 +0000 (-0400) Subject: pybind/rbd: RBD.create() method's 'old_format' parameter now defaults to False X-Git-Tag: v14.2.10~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9754818bd3002b162319c94da62ff99549c4ee7;p=ceph.git pybind/rbd: RBD.create() method's 'old_format' parameter now defaults to False The RBD v1 format has been deprecated for numerous releases and creation of v1 format images has been disabled since the Mimic release. This fixes the Python API's image create() method to ensure v2 images are created by default (and no longer throw an exception that creation of v1 images are disabled). Fixes: https://tracker.ceph.com/issues/45504 Signed-off-by: Jason Dillaman (cherry picked from commit 45349355f4b41c6f9de594ef34a8657230113e6b) --- diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 4d89731e4e6..8789c9d48af 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -1057,7 +1057,7 @@ class RBD(object): rbd_version(&major, &minor, &extra) return (major, minor, extra) - def create(self, ioctx, name, size, order=None, old_format=True, + def create(self, ioctx, name, size, order=None, old_format=False, features=None, stripe_unit=None, stripe_count=None, data_pool=None): """ diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 2ef190eb5c1..eb07eb7c6c8 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -183,7 +183,7 @@ def check_default_params(format, order=None, features=None, stripe_count=None, feature_data_pool = 128 image_name = get_temp_image_name() if exception is None: - RBD().create(ioctx, image_name, IMG_SIZE) + RBD().create(ioctx, image_name, IMG_SIZE, old_format=(format == 1)) try: with Image(ioctx, image_name) as image: eq(format == 1, image.old_format())