]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerSunny Kumar <sunkumar@redhat.com>
Thu, 24 Feb 2022 17:39:17 +0000 (17:39 +0000)
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>
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: