Merge "Fix callback method interface to remove warning by tenacity"

This commit is contained in:
Zuul 2022-02-22 10:08:39 +00:00 committed by Gerrit Code Review
commit 15f59c4149

View File

@ -32,6 +32,11 @@ LOG = logging.getLogger(__name__)
CONF = cfg.CONF
def _raise_compute_exception(retry_state):
LOG.exception("Error retrieving nova virtual machine.")
raise exceptions.ComputeGetException()
class VirtualMachineManager(compute_base.ComputeBase):
'''Compute implementation of virtual machines via nova.'''
@ -180,10 +185,6 @@ class VirtualMachineManager(compute_base.ComputeBase):
raise exceptions.ComputeStatusException() from e
return constants.DOWN
def _raise_compute_exception(self):
LOG.exception("Error retrieving nova virtual machine.")
raise exceptions.ComputeGetException()
@tenacity.retry(retry=tenacity.retry_if_exception_type(),
stop=tenacity.stop_after_attempt(CONF.compute.max_retries),
retry_error_callback=_raise_compute_exception,