Support later tenacity versions

Instead of lambda func use the defined
retry_never Retrying class.

Change-Id: I756b44443d8b5892c04bd1be9faa010e39c763fc
This commit is contained in:
Tobias Urdin 2022-02-15 21:37:06 +00:00 committed by Tobias Urdin
parent 7ee2780af8
commit 5fbb63fa4f
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ stevedore>=1.16.0 # Apache-2.0
voluptuous>=0.8.9 # BSD License
msgpack>=0.4.0 # Apache-2.0
fasteners>=0.7 # Apache-2.0
tenacity>=3.2.1,<7.0.0 # Apache-2.0
tenacity>=3.2.1 # Apache-2.0
futurist>=1.2.0 # Apache-2.0
oslo.utils>=4.7.0 # Apache-2.0
oslo.serialization>=1.10.0 # Apache-2.0

View File

@ -22,7 +22,7 @@ _default_wait = wait.wait_exponential(max=1)
def retry(stop_max_delay=None, **kwargs):
k = {"wait": _default_wait, "retry": lambda x: False}
k = {"wait": _default_wait, "retry": tenacity.retry_never}
if stop_max_delay not in (True, False, None):
k['stop'] = stop.stop_after_delay(stop_max_delay)
return tenacity.retry(**k)