summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python3-hp3parclient
diff options
context:
space:
mode:
authorzangrc <zangrc.fnst@cn.fujitsu.com>2020-09-19 05:22:03 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-09-21 17:34:21 -0400
commit0526abaa46612750ef332dbecd31291dee27a6c7 (patch)
tree00a2d4eaddfab7f45756ebd659cd89ef50d1ee61 /meta-openstack/recipes-devtools/python/python3-hp3parclient
parent0ef08fccf74e0b99b27d1947084c96d5fc3d3883 (diff)
downloadmeta-cloud-services-0526abaa46612750ef332dbecd31291dee27a6c7.tar.gz
python3-hp3parclient: Change to python3
Refresh the following patch: fix_hp3parclient_memory_leak.patch Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python3-hp3parclient')
-rw-r--r--meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch b/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch
new file mode 100644
index 0000000..25aebc0
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch
@@ -0,0 +1,37 @@
1---
2 hp3parclient/http.py | 10 ++++++++++
3 1 file changed, 10 insertions(+)
4
5--- a/hp3parclient/http.py
6+++ b/hp3parclient/http.py
7@@ -66,6 +66,7 @@
8 self.set_debug_flag(http_log_debug)
9
10 self.times = [] # [("item", starttime, endtime), ...]
11+ self.times_max_len = 200
12
13 # httplib2 overrides
14 self.force_exception_to_status_code = True
15@@ -141,6 +142,12 @@
16 """
17 self.times = []
18
19+ def get_timings_max_len(self):
20+ return self.times_max_len
21+
22+ def set_timings_max_len(self, new_len):
23+ self.times_max_len = new_len
24+
25 def _http_log_req(self, args, kwargs):
26 if not self.http_log_debug:
27 return
28@@ -208,6 +215,9 @@
29 resp, body = self.request(url, method, **kwargs)
30 self.times.append(("%s %s" % (method, url),
31 start_time, time.time()))
32+ # remove oldest items until we maintain max length
33+ while len(self.times) > self.times_max_len:
34+ del self.times[0]
35 return resp, body
36
37 def _do_reauth(self, url, method, ex, **kwargs):