Merge "Only use LOG.exception in exception handler"

This commit is contained in:
Jenkins 2015-10-16 23:10:28 +00:00 committed by Gerrit Code Review
commit 37a826d1fe
4 changed files with 11 additions and 11 deletions

View File

@ -425,8 +425,8 @@ class BaseVD(object):
# flag in the interface is for anticipation that it will be enabled
# in the future.
if remote:
LOG.exception(_LE("Detaching snapshot from a remote node "
"is not supported."))
LOG.error(_LE("Detaching snapshot from a remote node "
"is not supported."))
raise exception.NotSupportedOperation(
operation=_("detach snapshot from remote node"))
else:
@ -993,8 +993,8 @@ class BaseVD(object):
# flag in the interface is for anticipation that it will be enabled
# in the future.
if remote:
LOG.exception(_LE("Attaching snapshot from a remote node "
"is not supported."))
LOG.error(_LE("Attaching snapshot from a remote node "
"is not supported."))
raise exception.NotSupportedOperation(
operation=_("attach snapshot from remote node"))
else:

View File

@ -697,7 +697,7 @@ class LVMVolumeDriver(driver.VolumeDriver):
"check your configuration because source and "
"destination are the same Volume Group: %(name)s.") %
{'id': volume['id'], 'name': self.vg.vg_name})
LOG.exception(message)
LOG.error(message)
raise exception.VolumeBackendAPIException(data=message)
def get_pool(self, volume):

View File

@ -807,8 +807,8 @@ class CreateVolumeFromSpecTask(flow_utils.CinderTask):
# we can't do anything if the driver didn't init
if not self.driver.initialized:
driver_name = self.driver.__class__.__name__
LOG.exception(_LE("Unable to create volume. "
"Volume driver %s not initialized"), driver_name)
LOG.error(_LE("Unable to create volume. "
"Volume driver %s not initialized"), driver_name)
raise exception.DriverNotInitialized()
create_type = volume_spec.pop('type', None)

View File

@ -2626,9 +2626,9 @@ class VolumeManager(manager.SchedulerDependentManager):
if model_update:
if model_update['status'] in ['error_deleting', 'error']:
msg = (_('Delete consistency group failed.'))
LOG.exception(msg,
resource={'type': 'consistency_group',
'id': group.id})
LOG.error(msg,
resource={'type': 'consistency_group',
'id': group.id})
raise exception.VolumeDriverException(message=msg)
else:
group.update(model_update)
@ -2779,7 +2779,7 @@ class VolumeManager(manager.SchedulerDependentManager):
if model_update['status'] in ['error']:
msg = (_('Error occurred when updating consistency group '
'%s.') % group.id)
LOG.exception(msg)
LOG.error(msg)
raise exception.VolumeDriverException(message=msg)
group.update(model_update)
group.save()