From 637e7b9d2e2c1ddf4e5fbb46395709efec53c7b0 Mon Sep 17 00:00:00 2001 From: Dongqi Chen Date: Wed, 12 Feb 2020 16:28:19 +0800 Subject: [PATCH] CentOS 8: Upgrade python-docker to version 4.0.2 (1)Release Version Upgrade (2)Matching code changes with el7 to el8 Story: 2006729 Task: 38744 Depends-On: https://review.opendev.org/#/c/700793/ Change-Id: I98272e33911854ae366f52fb3c7fc1b0b43682ea Signed-off-by: Dongqi Chen --- .../0001-Add-package-versioning.patch | 13 +++++----- ...0002-Update-spec-include-stx-patches.patch | 26 +++++++++---------- .../0001-Update-client-close-socket.patch | 15 ++++++----- docker/python-docker/centos/srpm_path | 2 +- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/docker/python-docker/centos/meta_patches/0001-Add-package-versioning.patch b/docker/python-docker/centos/meta_patches/0001-Add-package-versioning.patch index b4274ac19..0c40a6ce5 100644 --- a/docker/python-docker/centos/meta_patches/0001-Add-package-versioning.patch +++ b/docker/python-docker/centos/meta_patches/0001-Add-package-versioning.patch @@ -3,6 +3,7 @@ From: John Kung Date: Wed, 7 Aug 2019 13:35:22 -0400 Subject: [PATCH 1/1] Add package versioning patch +Signed-off-by: Dongqi Chen --- SPECS/python-docker.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -11,15 +12,15 @@ diff --git a/SPECS/python-docker.spec b/SPECS/python-docker.spec index 5ebf252..92420e3 100644 --- a/SPECS/python-docker.spec +++ b/SPECS/python-docker.spec -@@ -18,7 +18,7 @@ +@@ -16,7 +16,7 @@ Name: python-%{srcname} - Version: 3.3.0 --Release: 1%{?dist} -+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver} + Version: 4.0.2 +-Release: 2%{?dist} ++Release: 2.el8%{?_tis_dist}.%{tis_patch_ver} Summary: A Python library for the Docker Engine API License: ASL 2.0 - URL: https://pypi.python.org/pypi/%{srcname} + URL: https://pypi.org/project/%{srcname} -- -1.8.3.1 +2.7.4 diff --git a/docker/python-docker/centos/meta_patches/0002-Update-spec-include-stx-patches.patch b/docker/python-docker/centos/meta_patches/0002-Update-spec-include-stx-patches.patch index 26127099e..fc5e678c3 100644 --- a/docker/python-docker/centos/meta_patches/0002-Update-spec-include-stx-patches.patch +++ b/docker/python-docker/centos/meta_patches/0002-Update-spec-include-stx-patches.patch @@ -3,33 +3,33 @@ From: John Kung Date: Wed, 7 Aug 2019 15:01:11 -0400 Subject: [PATCH 1/1] Update-spec-include-stx-patches +Signed-off-by: Dongqi Chen --- - SPECS/python-docker.spec | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + SPECS/python-docker.spec | 4 ++++ + 1 file changed, 4 insertions(+) diff --git a/SPECS/python-docker.spec b/SPECS/python-docker.spec index 92420e3..9a05819 100644 --- a/SPECS/python-docker.spec +++ b/SPECS/python-docker.spec -@@ -29,6 +29,7 @@ Source0: https://files.pythonhosted.org/packages/source/d/%{srcname}/%{sr - # work in RHEL. This patch converts those environment markers into simple if - # statements. - Patch1: remove-environment-markers.patch -+Patch2: 0001-Update-client-close-socket.patch +@@ -22,6 +22,8 @@ License: ASL 2.0 + URL: https://pypi.org/project/%{srcname} + Source0: https://files.pythonhosted.org/packages/source/d/%{srcname}/%{srcname}-%{version}.tar.gz ++Patch1: 0001-Update-client-close-socket.patch ++ BuildArch: noarch -@@ -138,7 +139,9 @@ run containers, manage containers, manage Swarms, etc. - %endif # with_python3 + %description +@@ -92,6 +94,8 @@ run containers, manage containers, manage Swarms, etc. %prep --%autosetup -n %{srcname}-%{version} -p 1 -+%setup -q -n %{srcname}-%{version} -+%patch2 -p1 + %setup -n %{srcname}-%{version} ++%patch1 -p1 + rm -fr docker.egg-info %build -- -1.8.3.1 +2.7.4 diff --git a/docker/python-docker/centos/patches/0001-Update-client-close-socket.patch b/docker/python-docker/centos/patches/0001-Update-client-close-socket.patch index bbd67d8e7..6e2ba9f66 100644 --- a/docker/python-docker/centos/patches/0001-Update-client-close-socket.patch +++ b/docker/python-docker/centos/patches/0001-Update-client-close-socket.patch @@ -3,26 +3,29 @@ From: John Kung Date: Wed, 7 Aug 2019 14:06:04 -0400 Subject: [PATCH 1/1] Update client close socket +Signed-off-by: Dongqi Chen --- - docker/api/client.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + docker/api/client.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/api/client.py b/docker/api/client.py index 13c292a..7df5eb1 100644 --- a/docker/api/client.py +++ b/docker/api/client.py -@@ -370,7 +370,10 @@ class APIClient( +@@ -411,8 +411,11 @@ class APIClient( if stream: return gen else: -- return six.binary_type().join(gen) +- # Wait for all the frames, concatenate them, and return the result +- return consume_socket_output(gen, demux=demux) + try: -+ return six.binary_type().join(gen) ++ # Wait for all the frames, concatenate them, and return the result ++ return consume_socket_output(gen, demux=demux) + finally: + response.close() def _disable_socket_timeout(self, socket): """ Depending on the combination of python version and whether we're -- -1.8.3.1 +2.7.4 diff --git a/docker/python-docker/centos/srpm_path b/docker/python-docker/centos/srpm_path index e6e872ca1..735ddf01e 100644 --- a/docker/python-docker/centos/srpm_path +++ b/docker/python-docker/centos/srpm_path @@ -1 +1 @@ -mirror:Source/python-docker-3.3.0-1.el7.src.rpm +mirror:Source/python-docker-4.0.2-2.el8.src.rpm