Merge "use 'exc_info=True' instead of import traceback"
This commit is contained in:
+1
-3
@@ -19,7 +19,6 @@
|
||||
"""Starter script for Nova Compute."""
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
@@ -44,9 +43,8 @@ def block_db_access():
|
||||
return self
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
stacktrace = "".join(traceback.format_stack())
|
||||
LOG = logging.getLogger('nova.compute')
|
||||
LOG.error('No db access allowed in nova-compute: %s' % stacktrace)
|
||||
LOG.error('No db access allowed in nova-compute: ', exc_info=True)
|
||||
raise exception.DBNotAllowed('nova-compute')
|
||||
|
||||
nova.db.api.IMPL = NoDB()
|
||||
|
||||
@@ -1052,10 +1052,8 @@ class ComputeManager(manager.SchedulerDependentManager):
|
||||
return instance, network_info
|
||||
|
||||
def _log_original_error(self, exc_info, instance_uuid):
|
||||
type_, value, tb = exc_info
|
||||
LOG.error(_('Error: %s') %
|
||||
traceback.format_exception(type_, value, tb),
|
||||
instance_uuid=instance_uuid)
|
||||
LOG.error(_('Error: %s') % exc_info[1].message,
|
||||
instance_uuid=instance_uuid, exc_info=exc_info)
|
||||
|
||||
def _reschedule_or_error(self, context, instance, exc_info,
|
||||
requested_networks, admin_password, injected_files, is_first_time,
|
||||
|
||||
Reference in New Issue
Block a user