Merge "Correct reraising of exception"
This commit is contained in:
commit
7a16eb685b
@ -89,7 +89,7 @@ class ManilaException(Exception):
|
||||
try:
|
||||
message = self.message % kwargs
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
# kwargs doesn't match a variable in the message
|
||||
# log the issue and the kwargs
|
||||
LOG.exception(_LE('Exception in string format operation.'))
|
||||
@ -97,7 +97,7 @@ class ManilaException(Exception):
|
||||
LOG.error(_LE("%(name)s: %(value)s"), {
|
||||
'name': name, 'value': value})
|
||||
if CONF.fatal_exception_format_errors:
|
||||
raise e
|
||||
raise
|
||||
else:
|
||||
# at least get the core message out if something happened
|
||||
message = self.message
|
||||
|
@ -254,7 +254,7 @@ class HNASSSHBackend(object):
|
||||
else:
|
||||
msg = six.text_type(e)
|
||||
LOG.exception(msg)
|
||||
raise e
|
||||
raise
|
||||
|
||||
def create_directory(self, dest_path):
|
||||
self._locked_selectfs('create', dest_path)
|
||||
@ -282,7 +282,7 @@ class HNASSSHBackend(object):
|
||||
if 'file system is already mounted' not in e.stderr:
|
||||
msg = six.text_type(e)
|
||||
LOG.exception(msg)
|
||||
raise e
|
||||
raise
|
||||
|
||||
def vvol_create(self, vvol_name):
|
||||
# create a virtual-volume inside directory
|
||||
@ -504,7 +504,7 @@ class HNASSSHBackend(object):
|
||||
else:
|
||||
msg = six.text_type(e)
|
||||
LOG.exception(msg)
|
||||
raise e
|
||||
raise
|
||||
|
||||
|
||||
class Export(object):
|
||||
|
@ -216,7 +216,7 @@ class RestHelper(object):
|
||||
|
||||
except Exception as err:
|
||||
LOG.error(_LE('Bad response from change file: %s.') % err)
|
||||
raise err
|
||||
raise
|
||||
|
||||
def create_share(self, share_name, fs_id, share_proto):
|
||||
"""Create a share."""
|
||||
|
@ -332,7 +332,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
||||
LOG.error(_LE("Volume %s is already offline."),
|
||||
root_volume_name)
|
||||
else:
|
||||
raise e
|
||||
raise
|
||||
vserver_client.delete_volume(root_volume_name)
|
||||
|
||||
elif volumes_count > 1:
|
||||
@ -925,7 +925,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
||||
if e.code == netapp_api.EAPINOTFOUND:
|
||||
return None
|
||||
else:
|
||||
raise e
|
||||
raise
|
||||
|
||||
if len(aggrs) < 1:
|
||||
return None
|
||||
@ -2589,7 +2589,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
||||
LOG.debug('Not connected to cluster management LIF.')
|
||||
return False
|
||||
else:
|
||||
raise e
|
||||
raise
|
||||
|
||||
@na_utils.trace
|
||||
def create_cluster_peer(self, addresses, username=None, password=None,
|
||||
|
@ -461,11 +461,11 @@ class TegileShareDriver(driver.ShareDriver):
|
||||
data['qos'] = False
|
||||
|
||||
super(TegileShareDriver, self)._update_share_stats(data)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
msg = _('Unexpected error while trying to get the '
|
||||
'usage stats from array.')
|
||||
LOG.exception(msg)
|
||||
raise e
|
||||
raise
|
||||
|
||||
@debugger
|
||||
def get_pool(self, share):
|
||||
|
@ -192,9 +192,9 @@ class RestClientURL(object): # pylint: disable=R0902
|
||||
message=("REST Not Available:"
|
||||
"Please Upgrade"))
|
||||
|
||||
except RestClientError as err:
|
||||
except RestClientError:
|
||||
del self.headers['authorization']
|
||||
raise err
|
||||
raise
|
||||
|
||||
def login(self, auth_str):
|
||||
"""Login to an appliance using a user name and password.
|
||||
|
@ -302,9 +302,9 @@ class ZFSSAShareDriver(driver.ShareDriver):
|
||||
name = driver_options['zfssa_name']
|
||||
try:
|
||||
details = self._get_share_details(name)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
LOG.error(_LE('Cannot manage share %s'), name)
|
||||
raise e
|
||||
raise
|
||||
|
||||
lcfg = self.configuration
|
||||
input_export_loc = share['export_locations'][0]['path']
|
||||
|
@ -511,7 +511,7 @@ class BaseSharesTest(test.BaseTestCase):
|
||||
d["share"] = cls._create_share(
|
||||
*d["args"], **d["kwargs"])
|
||||
else:
|
||||
raise e
|
||||
raise
|
||||
|
||||
return [d["share"] for d in data]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user