From db057d5938cca5202a3569f9164635069e1f1331 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 13 Nov 2020 13:33:03 +0800 Subject: [PATCH] pybind/mgr/volumes: use = for equality comparision should not rely on the internal implementation of Python to check the equality of two strings. Signed-off-by: Kefu Chai --- src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py index 1847f45b1e9a4..3ed9562da1e85 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py @@ -256,7 +256,7 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): # Construct auth caps that if present might conflict with the desired # auth caps. - unwanted_access_level = 'r' if access_level is 'rw' else 'rw' + unwanted_access_level = 'r' if access_level == 'rw' else 'rw' unwanted_mds_cap = 'allow {0} path={1}'.format(unwanted_access_level, subvol_path.decode('utf-8')) unwanted_osd_cap = "allow {0} pool={1}{2}".format( unwanted_access_level, pool, " namespace={0}".format(namespace) if namespace else "") -- 2.39.5