Merge "use 'exc_info=True' instead of import traceback"

This commit is contained in:
Jenkins
2013-08-28 06:41:59 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 7 deletions
+1 -3
View File
@@ -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()
+2 -4
View File
@@ -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,