From fd5488ed2c64726fb36321a836cdff4de92454bd Mon Sep 17 00:00:00 2001 From: Alexander Indenbaum Date: Thu, 28 Mar 2024 07:20:11 +0000 Subject: [PATCH] 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 --- src/pybind/cephfs/setup.py | 3 ++- src/pybind/rados/setup.py | 3 ++- src/pybind/rbd/setup.py | 3 ++- src/pybind/rgw/setup.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py index 956a4e7008c6..e6547103c705 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 000189b7da13..cd99fb457c17 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 b03d1c3fc957..4f247273796e 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 eb8fc554db6e..a39f8d4e5453 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 -- 2.47.3