From 0526abaa46612750ef332dbecd31291dee27a6c7 Mon Sep 17 00:00:00 2001 From: zangrc Date: Sat, 19 Sep 2020 05:22:03 +0800 Subject: python3-hp3parclient: Change to python3 Refresh the following patch: fix_hp3parclient_memory_leak.patch Signed-off-by: Zang Ruochen Signed-off-by: Bruce Ashfield --- .../fix_hp3parclient_memory_leak.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python3-hp3parclient/fix_hp3parclient_memory_leak.patch (limited to 'meta-openstack/recipes-devtools/python/python3-hp3parclient') 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 @@ +--- + hp3parclient/http.py | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/hp3parclient/http.py ++++ b/hp3parclient/http.py +@@ -66,6 +66,7 @@ + self.set_debug_flag(http_log_debug) + + self.times = [] # [("item", starttime, endtime), ...] ++ self.times_max_len = 200 + + # httplib2 overrides + self.force_exception_to_status_code = True +@@ -141,6 +142,12 @@ + """ + self.times = [] + ++ def get_timings_max_len(self): ++ return self.times_max_len ++ ++ def set_timings_max_len(self, new_len): ++ self.times_max_len = new_len ++ + def _http_log_req(self, args, kwargs): + if not self.http_log_debug: + return +@@ -208,6 +215,9 @@ + resp, body = self.request(url, method, **kwargs) + self.times.append(("%s %s" % (method, url), + start_time, time.time())) ++ # remove oldest items until we maintain max length ++ while len(self.times) > self.times_max_len: ++ del self.times[0] + return resp, body + + def _do_reauth(self, url, method, ex, **kwargs): -- cgit v1.2.3-54-g00ecf