]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/rbd: RBD.create() method's 'old_format' parameter now defaults to False
authorJason Dillaman <dillaman@redhat.com>
Mon, 11 May 2020 23:55:50 +0000 (19:55 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 11 May 2020 23:55:50 +0000 (19:55 -0400)
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 <dillaman@redhat.com>
src/pybind/rbd/rbd.pyx
src/test/pybind/test_rbd.py

index 8b8140dc4cecf5532b43a8b564256ab8f786b8be..72cfda55650b8ac649f0c4f7cc5afc6dcee21390 100644 (file)
@@ -1180,7 +1180,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):
         """
index a18e80d393f31c618452f757cf0bbfcab63fbfec..e97bc2805c113f485a467597657c2d0bf11de63a 100644 (file)
@@ -190,7 +190,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())