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 <chen.dq@neusoft.com>
This commit is contained in:
Dongqi Chen 2020-02-12 16:28:19 +08:00
parent 6cf6e96910
commit 637e7b9d2e
4 changed files with 30 additions and 26 deletions

View File

@ -3,6 +3,7 @@ From: John Kung <john.kung@windriver.com>
Date: Wed, 7 Aug 2019 13:35:22 -0400 Date: Wed, 7 Aug 2019 13:35:22 -0400
Subject: [PATCH 1/1] Add package versioning patch Subject: [PATCH 1/1] Add package versioning patch
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
--- ---
SPECS/python-docker.spec | 2 +- SPECS/python-docker.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 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 index 5ebf252..92420e3 100644
--- a/SPECS/python-docker.spec --- a/SPECS/python-docker.spec
+++ b/SPECS/python-docker.spec +++ b/SPECS/python-docker.spec
@@ -18,7 +18,7 @@ @@ -16,7 +16,7 @@
Name: python-%{srcname} Name: python-%{srcname}
Version: 3.3.0 Version: 4.0.2
-Release: 1%{?dist} -Release: 2%{?dist}
+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver} +Release: 2.el8%{?_tis_dist}.%{tis_patch_ver}
Summary: A Python library for the Docker Engine API Summary: A Python library for the Docker Engine API
License: ASL 2.0 License: ASL 2.0
URL: https://pypi.python.org/pypi/%{srcname} URL: https://pypi.org/project/%{srcname}
-- --
1.8.3.1 2.7.4

View File

@ -3,33 +3,33 @@ From: John Kung <john.kung@windriver.com>
Date: Wed, 7 Aug 2019 15:01:11 -0400 Date: Wed, 7 Aug 2019 15:01:11 -0400
Subject: [PATCH 1/1] Update-spec-include-stx-patches Subject: [PATCH 1/1] Update-spec-include-stx-patches
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
--- ---
SPECS/python-docker.spec | 5 ++++- SPECS/python-docker.spec | 4 ++++
1 file changed, 4 insertions(+), 1 deletion(-) 1 file changed, 4 insertions(+)
diff --git a/SPECS/python-docker.spec b/SPECS/python-docker.spec diff --git a/SPECS/python-docker.spec b/SPECS/python-docker.spec
index 92420e3..9a05819 100644 index 92420e3..9a05819 100644
--- a/SPECS/python-docker.spec --- a/SPECS/python-docker.spec
+++ b/SPECS/python-docker.spec +++ b/SPECS/python-docker.spec
@@ -29,6 +29,7 @@ Source0: https://files.pythonhosted.org/packages/source/d/%{srcname}/%{sr @@ -22,6 +22,8 @@ License: ASL 2.0
# work in RHEL. This patch converts those environment markers into simple if URL: https://pypi.org/project/%{srcname}
# statements. Source0: https://files.pythonhosted.org/packages/source/d/%{srcname}/%{srcname}-%{version}.tar.gz
Patch1: remove-environment-markers.patch
+Patch2: 0001-Update-client-close-socket.patch
+Patch1: 0001-Update-client-close-socket.patch
+
BuildArch: noarch BuildArch: noarch
@@ -138,7 +139,9 @@ run containers, manage containers, manage Swarms, etc. %description
%endif # with_python3 @@ -92,6 +94,8 @@ run containers, manage containers, manage Swarms, etc.
%prep %prep
-%autosetup -n %{srcname}-%{version} -p 1 %setup -n %{srcname}-%{version}
+%setup -q -n %{srcname}-%{version} +%patch1 -p1
+%patch2 -p1
+ +
rm -fr docker.egg-info rm -fr docker.egg-info
%build %build
-- --
1.8.3.1 2.7.4

View File

@ -3,26 +3,29 @@ From: John Kung <john.kung@windriver.com>
Date: Wed, 7 Aug 2019 14:06:04 -0400 Date: Wed, 7 Aug 2019 14:06:04 -0400
Subject: [PATCH 1/1] Update client close socket Subject: [PATCH 1/1] Update client close socket
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
--- ---
docker/api/client.py | 5 ++++- docker/api/client.py | 7 +++++--
1 file changed, 4 insertions(+), 1 deletion(-) 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/docker/api/client.py b/docker/api/client.py diff --git a/docker/api/client.py b/docker/api/client.py
index 13c292a..7df5eb1 100644 index 13c292a..7df5eb1 100644
--- a/docker/api/client.py --- a/docker/api/client.py
+++ b/docker/api/client.py +++ b/docker/api/client.py
@@ -370,7 +370,10 @@ class APIClient( @@ -411,8 +411,11 @@ class APIClient(
if stream: if stream:
return gen return gen
else: 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: + 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: + finally:
+ response.close() + response.close()
def _disable_socket_timeout(self, socket): def _disable_socket_timeout(self, socket):
""" Depending on the combination of python version and whether we're """ Depending on the combination of python version and whether we're
-- --
1.8.3.1 2.7.4

View File

@ -1 +1 @@
mirror:Source/python-docker-3.3.0-1.el7.src.rpm mirror:Source/python-docker-4.0.2-2.el8.src.rpm