]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/volumes: use = for equality comparision 38056/head
authorKefu Chai <kchai@redhat.com>
Fri, 13 Nov 2020 05:33:03 +0000 (13:33 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Nov 2020 06:18:19 +0000 (14:18 +0800)
should not rely on the internal implementation of Python to check the
equality of two strings.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py

index 1847f45b1e9a444a2085d7492701fab96885dd95..3ed9562da1e85855f6ba49490a10fb763ab8262b 100644 (file)
@@ -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 "")