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
