diff --git a/manila/exception.py b/manila/exception.py index f20663b7a0..459b76a1f4 100644 --- a/manila/exception.py +++ b/manila/exception.py @@ -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 diff --git a/manila/share/drivers/hitachi/hnas/ssh.py b/manila/share/drivers/hitachi/hnas/ssh.py index a62d86693d..36c49c61cb 100644 --- a/manila/share/drivers/hitachi/hnas/ssh.py +++ b/manila/share/drivers/hitachi/hnas/ssh.py @@ -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): diff --git a/manila/share/drivers/huawei/v3/helper.py b/manila/share/drivers/huawei/v3/helper.py index dacbfbfde7..847300bff8 100644 --- a/manila/share/drivers/huawei/v3/helper.py +++ b/manila/share/drivers/huawei/v3/helper.py @@ -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.""" diff --git a/manila/share/drivers/netapp/dataontap/client/client_cmode.py b/manila/share/drivers/netapp/dataontap/client/client_cmode.py index acac70eb52..7f5ed24867 100644 --- a/manila/share/drivers/netapp/dataontap/client/client_cmode.py +++ b/manila/share/drivers/netapp/dataontap/client/client_cmode.py @@ -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, diff --git a/manila/share/drivers/tegile/tegile.py b/manila/share/drivers/tegile/tegile.py index fbd25c0c3e..f632c93148 100644 --- a/manila/share/drivers/tegile/tegile.py +++ b/manila/share/drivers/tegile/tegile.py @@ -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): diff --git a/manila/share/drivers/zfssa/restclient.py b/manila/share/drivers/zfssa/restclient.py index 4a1fb716dc..47e801387c 100644 --- a/manila/share/drivers/zfssa/restclient.py +++ b/manila/share/drivers/zfssa/restclient.py @@ -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. diff --git a/manila/share/drivers/zfssa/zfssashare.py b/manila/share/drivers/zfssa/zfssashare.py index 8990dc9195..1b2d28746b 100644 --- a/manila/share/drivers/zfssa/zfssashare.py +++ b/manila/share/drivers/zfssa/zfssashare.py @@ -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'] diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py index 768a115b55..a36f39196e 100644 --- a/manila_tempest_tests/tests/api/base.py +++ b/manila_tempest_tests/tests/api/base.py @@ -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]