Use LOG.exception in except block in status module

LOG.error doesn't display a stacktrace even when called in an except
block. It makes hard for operators to analyze the cause of the error.

LOG.exception displays a stacktrace as well as log messages. It helps
the operator to find out more about the error from log messages.

Change-Id: I365152b631870c1b949a29ac73b3ad2bd077bffa
This commit is contained in:
Masahito Muroi 2019-01-29 12:11:13 +09:00 committed by Pierre Riteau
parent 98a203b3e7
commit 3d22669334

View File

@ -203,7 +203,7 @@ class LeaseStatus(BaseStatus):
try:
result = func(*args, **kwargs)
except Exception as e:
LOG.error('Lease %s went into ERROR status. %s',
LOG.exception('Lease %s went into ERROR status. %s',
lease_id, str(e))
db_api.lease_update(lease_id,
{'status': cls.ERROR})