From 05f2cfd9b5fdd34afc7f65685e57024dc183619f Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Thu, 24 Feb 2022 16:07:39 +0000 Subject: [PATCH] mgr/rbd_support: cast pool_id from int to str when collecting LevelSpec 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 --- src/pybind/mgr/rbd_support/schedule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/rbd_support/schedule.py b/src/pybind/mgr/rbd_support/schedule.py index 615c002a043..b8507a1b8fe 100644 --- a/src/pybind/mgr/rbd_support/schedule.py +++ b/src/pybind/mgr/rbd_support/schedule.py @@ -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: -- 2.39.5