diff --git a/0001-fix-the-array.tostring-for-py39.patch b/0001-fix-the-array.tostring-for-py39.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b2c6e2a98eb890a63c8ea571149829d7dd5875d --- /dev/null +++ b/0001-fix-the-array.tostring-for-py39.patch @@ -0,0 +1,70 @@ +From 22c11f852ec1ef5af196388ba06a08e02bab7d99 Mon Sep 17 00:00:00 2001 +From: FFrog +Date: Fri, 11 Mar 2022 11:12:48 +0800 +Subject: [PATCH] fix the array.tostring for py39 + +--- + swift/common/ring/ring.py | 8 +++++++- + test/unit/common/test_manager.py | 6 +++--- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/swift/common/ring/ring.py b/swift/common/ring/ring.py +index ed888e2..4fdfc8c 100644 +--- a/swift/common/ring/ring.py ++++ b/swift/common/ring/ring.py +@@ -28,6 +28,7 @@ from itertools import chain, count + from tempfile import NamedTemporaryFile + import sys + ++import six + from six.moves import range + + from swift.common.exceptions import RingLoadError +@@ -148,7 +149,12 @@ class RingData(object): + file_obj.write(struct.pack('!I', json_len)) + file_obj.write(json_text) + for part2dev_id in ring['replica2part2dev_id']: +- file_obj.write(part2dev_id.tostring()) ++ if six.PY2: ++ # Can't just use tofile() because a GzipFile apparently ++ # doesn't count as an 'open file' ++ file_obj.write(part2dev_id.tostring()) ++ else: ++ part2dev_id.tofile(file_obj) + + def save(self, filename, mtime=1300507380.0): + """ +diff --git a/test/unit/common/test_manager.py b/test/unit/common/test_manager.py +index 1191bd3..611fa4e 100644 +--- a/test/unit/common/test_manager.py ++++ b/test/unit/common/test_manager.py +@@ -1305,7 +1305,7 @@ class TestServer(unittest.TestCase): + return self + + def __exit__(self, *args): +- if self.isAlive(): ++ if self.is_alive(): + self.join() + + def close_stdout(self): +@@ -1359,7 +1359,7 @@ class TestServer(unittest.TestCase): + status = server.wait() + self.assertEqual(status, 0) + # wait should return before process exits +- self.assertTrue(proc.isAlive()) ++ self.assertTrue(proc.is_alive()) + self.assertFalse(proc.finished) + self.assertTrue(proc.finished) # make sure it did finish + # test output kwarg prints subprocess output +@@ -1385,7 +1385,7 @@ class TestServer(unittest.TestCase): + status = server.wait() + self.assertEqual(status, 0) + for proc in procs: +- self.assertTrue(proc.isAlive()) ++ self.assertTrue(proc.is_alive()) + for proc in procs: + proc.join() + finally: +-- +2.23.0 + diff --git a/openstack-swift.spec b/openstack-swift.spec index 30af7d781afe6aabcf66de691c441339199bcd60..ddee8832de30b6fbe52bf82a1ebbbb5398873294 100644 --- a/openstack-swift.spec +++ b/openstack-swift.spec @@ -16,7 +16,7 @@ expensive equipment. Name: openstack-swift Version: 2.23.3 -Release: 2 +Release: 3 Summary: OpenStack Object Storage License: ASL 2.0 URL: https://docs.openstack.org/swift/latest/ @@ -67,6 +67,8 @@ Source75: %{name}-container-sync.service Source76: %{name}-container-sync@.service Source77: internal-client.conf +Patch1: 0001-fix-the-array.tostring-for-py39.patch + BuildArch: noarch BuildRequires: openstack-macros @@ -208,7 +210,7 @@ This package contains documentation files for %{name}. %prep # Required for tarball sources verification -%autosetup -n swift-%{upstream_version} -S git +%autosetup -n swift-%{upstream_version} -p1 # Let RPM handle the dependencies %py_req_cleanup @@ -580,6 +582,9 @@ exit 0 %endif %changelog +* Tue Mar 08 2022 lijiawei - 2.23.3-3 +- Fix the array.tostring for py39 + * Tue Dec 21 2021 huangtianhua - 2.23.3-2 - Adds the missing sections to config files