File: Support-later-versions-of-tenacity.patch

package info (click to toggle)
gnocchi 4.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,180 kB
  • sloc: python: 19,372; sh: 282; makefile: 60
file content (49 lines) | stat: -rw-r--r-- 1,653 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From ec2ad91ace423338cadec4fcfed194ee239353bf Mon Sep 17 00:00:00 2001
From: Tobias Urdin <tobias.urdin@binero.se>
Date: Tue, 15 Feb 2022 21:39:15 +0000
Subject: [PATCH] Support later versions of tenacity

This adds support for later version of the
tenacity library and unpins the dependency.

This depends on the tooz [1] change or it
will fail.

[1] https://review.opendev.org/c/openstack/tooz/+/829412
---
 gnocchi/utils.py | 8 ++++----
 setup.cfg        | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Index: gnocchi/gnocchi/utils.py
===================================================================
--- gnocchi.orig/gnocchi/utils.py
+++ gnocchi/gnocchi/utils.py
@@ -354,10 +354,10 @@ class _retry_on_exception_and_log(tenaci
         super(_retry_on_exception_and_log, self).__init__()
         self.msg = msg
 
-    def __call__(self, attempt):
-        if attempt.failed:
-            LOG.error(self.msg, exc_info=attempt.exception())
-        return super(_retry_on_exception_and_log, self).__call__(attempt)
+    def __call__(self, retry_state):
+        if retry_state.outcome.failed:
+            LOG.error(self.msg, exc_info=retry_state.outcome.exception())
+        return super(_retry_on_exception_and_log, self).__call__(retry_state)
 
 
 def retry_on_exception_and_log(msg):
Index: gnocchi/setup.cfg
===================================================================
--- gnocchi.orig/setup.cfg
+++ gnocchi/setup.cfg
@@ -41,7 +41,7 @@ install_requires =
     voluptuous>=0.8.10
     werkzeug
     trollius; python_version < '3.4'
-    tenacity>=4.6.0,<7.0.0
+    tenacity>=4.6.0
     WebOb>=1.4.1
     Paste
     PasteDeploy