integ/docker/python-docker/centos/patches/0001-Update-client-close-socket.patch
Dongqi Chen 637e7b9d2e 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>
2020-02-12 16:33:07 +08:00

32 lines
1.0 KiB
Diff

From cbe001760e9893015b1576cba05ebce0938038e4 Mon Sep 17 00:00:00 2001
From: John Kung <john.kung@windriver.com>
Date: Wed, 7 Aug 2019 14:06:04 -0400
Subject: [PATCH 1/1] Update client close socket
Signed-off-by: Dongqi Chen <chen.dq@neusoft.com>
---
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
@@ -411,8 +411,11 @@ class APIClient(
if stream:
return gen
else:
- # Wait for all the frames, concatenate them, and return the result
- return consume_socket_output(gen, demux=demux)
+ try:
+ # 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
--
2.7.4