]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rbd_support: cast pool_id from int to str when collecting LevelSpec
authorSunny Kumar <sunkumar@redhat.com>
Thu, 24 Feb 2022 16:07:39 +0000 (16:07 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 7 Mar 2022 11:19:52 +0000 (12:19 +0100)
While collecting LevelSpec using class method from_name make sure to cast
pool_id from int to string. This is necessary to match the internal
representation of LevelSpec where pool_id is maintained as str.

Fixes: https://tracker.ceph.com/issues/53915
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
(cherry picked from commit 05f2cfd9b5fdd34afc7f65685e57024dc183619f)

src/pybind/mgr/rbd_support/schedule.py

index 615c002a043d9651dde483c95fbf23bcc2f87054..b8507a1b8fe5b8876ed05d44171ac17a7dc7cf29 100644 (file)
@@ -125,7 +125,8 @@ class LevelSpec:
                     raise ValueError("pool {} does not exist".format(pool_name))
                 if pool_id not in get_rbd_pools(module):
                     raise ValueError("{} is not an RBD pool".format(pool_name))
-                id += str(pool_id)
+                pool_id = str(pool_id)
+                id += pool_id
                 if match.group(2) is not None or match.group(3):
                     id += "/"
                     with module.rados.open_ioctx(pool_name) as ioctx: