From: Kefu Chai Date: Fri, 13 Nov 2020 05:33:03 +0000 (+0800) Subject: pybind/mgr/volumes: use = for equality comparision X-Git-Tag: v16.1.0~596^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38056%2Fhead;p=ceph.git 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 --- 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 1847f45b1e9..3ed9562da1e 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 "")