From: Alexander Indenbaum Date: Thu, 28 Mar 2024 07:20:11 +0000 (+0000) Subject: pybind: use syntax supported by python3.6 X-Git-Tag: v20.0.0~2263^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F56544%2Fhead;p=ceph.git pybind: use syntax supported by python3.6 Fixes: f68248944815acbf5fb08ef66f36da6d5baef824 It seems the shaman CentOS8 builders, which serve as the base for container images, aren't current with the ":=" syntax. Amend to support RHEL8, whose default python is python 3.6.8. Error example from https://shaman.ceph.com/builds/ceph/ceph-nvmeof-mon/27188b78bdbaa3c33de518b8514906de629e774a/default/388913/ File "/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/19.0.0-2505-g27188b78/rpm/el8/BUILD/ceph-19.0.0-2505-g27188b78/src/pybind/cephfs/setup.py", line 120 if ldflags := os.environ.get('LDFLAGS'): ^ SyntaxError: invalid syntax Signed-off-by: Alexander Indenbaum --- diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py index 956a4e7008c..e6547103c70 100755 --- a/src/pybind/cephfs/setup.py +++ b/src/pybind/cephfs/setup.py @@ -117,7 +117,8 @@ def check_sanity(): extra_preargs=['-iquote{path}'.format(path=os.path.join(CEPH_SRC_DIR, 'include'))] ) - if ldflags := os.environ.get('LDFLAGS'): + ldflags = os.environ.get('LDFLAGS') + if ldflags: extra_postargs = ldflags.split() else: extra_postargs = None diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py index 000189b7da1..cd99fb457c1 100755 --- a/src/pybind/rados/setup.py +++ b/src/pybind/rados/setup.py @@ -112,7 +112,8 @@ def check_sanity(): sources=[tmp_file], output_dir=tmp_dir ) - if ldflags := os.environ.get('LDFLAGS'): + ldflags = os.environ.get('LDFLAGS') + if ldflags: extra_postargs = ldflags.split() else: extra_postargs = None diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py index b03d1c3fc95..4f247273796 100755 --- a/src/pybind/rbd/setup.py +++ b/src/pybind/rbd/setup.py @@ -116,7 +116,8 @@ def check_sanity(): output_dir=tmp_dir ) - if ldflags := os.environ.get('LDFLAGS'): + ldflags = os.environ.get('LDFLAGS') + if ldflags: extra_postargs = ldflags.split() else: extra_postargs = None diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py index eb8fc554db6..a39f8d4e545 100755 --- a/src/pybind/rgw/setup.py +++ b/src/pybind/rgw/setup.py @@ -116,7 +116,8 @@ def check_sanity(): output_dir=tmp_dir, ) - if ldflags := os.environ.get('LDFLAGS'): + ldflags = os.environ.get('LDFLAGS') + if ldflags: extra_postargs = ldflags.split() else: extra_postargs = None