From 49ed717dd288e17dd2540e25ddffcab3f48c755b Mon Sep 17 00:00:00 2001 From: xiexs Date: Sun, 14 Aug 2016 22:18:33 -0400 Subject: [PATCH] Refactor the usage of save_and_reraise_exception Instead assigning the reraise flag as False in the exception context, we'd better set it to False initially while calling the save_and_reraise_exception(). Change-Id: I9e49c36003256ab77f2635a1c41d2cc2ebc84814 --- cinder/volume/drivers/falconstor/fss_common.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cinder/volume/drivers/falconstor/fss_common.py b/cinder/volume/drivers/falconstor/fss_common.py index 9d8c9739a59..10fd0f78aa5 100644 --- a/cinder/volume/drivers/falconstor/fss_common.py +++ b/cinder/volume/drivers/falconstor/fss_common.py @@ -191,8 +191,7 @@ class FalconstorBaseDriver(san.SanDriver): try: self.proxy.delete_vdev(volume) except rest_proxy.FSSHTTPError as err: - with excutils.save_and_reraise_exception() as ctxt: - ctxt.reraise = False + with excutils.save_and_reraise_exception(reraise=False): LOG.warning(_LW("Volume deletion failed with message: %s"), err.reason) @@ -208,8 +207,7 @@ class FalconstorBaseDriver(san.SanDriver): try: self.proxy.delete_snapshot(snapshot) except rest_proxy.FSSHTTPError as err: - with excutils.save_and_reraise_exception() as ctxt: - ctxt.reraise = False + with excutils.save_and_reraise_exception(reraise=False): LOG.error( _LE("Snapshot deletion failed with message: %s"), err.reason) @@ -226,8 +224,7 @@ class FalconstorBaseDriver(san.SanDriver): extend_volume_name = self.proxy._get_fss_volume_name(volume) self.proxy.extend_vdev(extend_volume_name, snap_size, vol_size) except rest_proxy.FSSHTTPError as err: - with excutils.save_and_reraise_exception() as ctxt: - ctxt.reraise = False + with excutils.save_and_reraise_exception(reraise=False): LOG.error(_LE( "Resizing %(id)s failed with message: %(msg)s. " "Cleaning volume."), {'id': volume["id"],