From 4b33f6dc7179fc260fd6e5eeba3eef0308af147f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C4=90=E1=BA=B7ng=20Minh=20D=C5=A9ng?= Date: Sun, 10 May 2020 11:37:23 +0700 Subject: [PATCH] pybind/ceph_volume_client: Fix PEP-8 SyntaxWarning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Đặng Minh Dũng (cherry picked from commit 3ce9a89a5a1a2d7fa3d57c597b781a6aece7cbb5) Origin: upstream, https://github.com/ceph/ceph/commit/7e45e2905f2f61bf9d100308df979f432754982b Gbp-Pq: Name CVE-2020-27781-1.patch --- src/pybind/ceph_volume_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/ceph_volume_client.py b/src/pybind/ceph_volume_client.py index 73406d837..923f12b0a 100644 --- a/src/pybind/ceph_volume_client.py +++ b/src/pybind/ceph_volume_client.py @@ -335,7 +335,7 @@ class CephFSVolumeClient(object): continue (group_id, volume_id) = volume.split('/') - group_id = group_id if group_id is not 'None' else None + group_id = group_id if group_id != 'None' else None volume_path = VolumePath(group_id, volume_id) access_level = volume_data['access_level'] @@ -358,7 +358,7 @@ class CephFSVolumeClient(object): if vol_meta['auths'][auth_id] == want_auth: continue - readonly = True if access_level is 'r' else False + readonly = access_level == 'r' self._authorize_volume(volume_path, auth_id, readonly) # Recovered from partial auth updates for the auth ID's access @@ -1084,7 +1084,7 @@ class CephFSVolumeClient(object): # Construct auth caps that if present might conflict with the desired # auth caps. - unwanted_access_level = 'r' if want_access_level is 'rw' else 'rw' + unwanted_access_level = 'r' if want_access_level == 'rw' else 'rw' unwanted_mds_cap = 'allow {0} path={1}'.format(unwanted_access_level, path) if namespace: unwanted_osd_cap = 'allow {0} pool={1} namespace={2}'.format( -- 2.30.2