Merge "Refactor the usage of save_and_reraise_exception"

This commit is contained in:
Jenkins 2016-10-30 22:48:01 +00:00 committed by Gerrit Code Review
commit 911a95542c

View File

@ -191,8 +191,7 @@ class FalconstorBaseDriver(san.SanDriver):
try: try:
self.proxy.delete_vdev(volume) self.proxy.delete_vdev(volume)
except rest_proxy.FSSHTTPError as err: except rest_proxy.FSSHTTPError as err:
with excutils.save_and_reraise_exception() as ctxt: with excutils.save_and_reraise_exception(reraise=False):
ctxt.reraise = False
LOG.warning(_LW("Volume deletion failed with message: %s"), LOG.warning(_LW("Volume deletion failed with message: %s"),
err.reason) err.reason)
@ -208,8 +207,7 @@ class FalconstorBaseDriver(san.SanDriver):
try: try:
self.proxy.delete_snapshot(snapshot) self.proxy.delete_snapshot(snapshot)
except rest_proxy.FSSHTTPError as err: except rest_proxy.FSSHTTPError as err:
with excutils.save_and_reraise_exception() as ctxt: with excutils.save_and_reraise_exception(reraise=False):
ctxt.reraise = False
LOG.error( LOG.error(
_LE("Snapshot deletion failed with message: %s"), _LE("Snapshot deletion failed with message: %s"),
err.reason) err.reason)
@ -226,8 +224,7 @@ class FalconstorBaseDriver(san.SanDriver):
extend_volume_name = self.proxy._get_fss_volume_name(volume) extend_volume_name = self.proxy._get_fss_volume_name(volume)
self.proxy.extend_vdev(extend_volume_name, snap_size, vol_size) self.proxy.extend_vdev(extend_volume_name, snap_size, vol_size)
except rest_proxy.FSSHTTPError as err: except rest_proxy.FSSHTTPError as err:
with excutils.save_and_reraise_exception() as ctxt: with excutils.save_and_reraise_exception(reraise=False):
ctxt.reraise = False
LOG.error(_LE( LOG.error(_LE(
"Resizing %(id)s failed with message: %(msg)s. " "Resizing %(id)s failed with message: %(msg)s. "
"Cleaning volume."), {'id': volume["id"], "Cleaning volume."), {'id': volume["id"],