Fix for tenacity 8.0.1

Use retry_state parameter that contains all information about
current retry invocation in the prepare_attempt callback.

Change-Id: Ib47b6335b591850965132448befb7b3dbe31984a
Task: 44471
This commit is contained in:
rabi 2022-02-11 18:13:37 +05:30
parent 0fa19e7a93
commit b1fe9752b0

View File

@ -407,8 +407,8 @@ class Resource(status.ResourceStatus):
# Retry in case a signal has updated the atomic_key
attempts = max(cfg.CONF.client_retry_limit, 0) + 1
def prepare_attempt(fn, attempt):
if attempt > 1:
def prepare_attempt(retry_state):
if retry_state.attempt_number > 1:
res_obj = resource_objects.Resource.get_obj(
self.context, self.id)
if (res_obj.engine_id is not None or