There were a few instances of the code calling LOG.exception
in places where there was not an exception in context. This
can cause errors and should just be LOG.error as it effectively
ends up being.
Some instances in vhdutils.py are being left as they are being
addressed in Ib3113f2c4752d37e890f97d259da5d51cbfcfb96 under a
different bug report.
Change-Id: I1898c4d63c16c4d41b3e255a7de21429d1b04ddb
Closes-bug: #
1504735
# 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:
# 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:
"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):
# 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)
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)
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()