From 50df32ceec6e3b5c26669d773527ba4ff7a6477e Mon Sep 17 00:00:00 2001 From: zhongjun Date: Thu, 15 Jun 2017 17:43:33 +0800 Subject: [PATCH] Use parenthesis instead of backslashes in share folder Use parenthesis instead of backslashes in share folder TrivialFix Change-Id: I6c2ea07b0bfc5852b28e44989406cc10eb972e39 --- manila/share/drivers/huawei/v3/helper.py | 6 ++-- .../drivers/netapp/dataontap/client/api.py | 36 +++++++++---------- .../netapp/dataontap/client/client_cmode.py | 6 ++-- .../dataontap/cluster_mode/lib_multi_svm.py | 8 ++--- .../dataontap/cluster_mode/lib_single_svm.py | 8 ++--- manila/share/drivers/zfssa/restclient.py | 4 +-- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/manila/share/drivers/huawei/v3/helper.py b/manila/share/drivers/huawei/v3/helper.py index ff8c78d1ce..5c3dc05365 100644 --- a/manila/share/drivers/huawei/v3/helper.py +++ b/manila/share/drivers/huawei/v3/helper.py @@ -79,9 +79,9 @@ class RestHelper(object): except Exception as err: LOG.error('\nBad response from server: %(url)s.' ' Error: %(err)s', {'url': url, 'err': err}) - res = '{"error":{"code":%s,' \ - '"description":"Connect server error"}}' \ - % constants.ERROR_CONNECT_TO_SERVER + res = ('{"error":{"code":%s,' + '"description":"Connect server error"}}' + % constants.ERROR_CONNECT_TO_SERVER) try: result = jsonutils.loads(res) diff --git a/manila/share/drivers/netapp/dataontap/client/api.py b/manila/share/drivers/netapp/dataontap/client/api.py index 10e0a67928..3c44196a12 100644 --- a/manila/share/drivers/netapp/dataontap/client/api.py +++ b/manila/share/drivers/netapp/dataontap/client/api.py @@ -149,8 +149,8 @@ class NaServer(object): try: self._api_major_version = int(major) self._api_minor_version = int(minor) - self._api_version = six.text_type(major) + "." + \ - six.text_type(minor) + self._api_version = (six.text_type(major) + "." + + six.text_type(minor)) except ValueError: raise ValueError('Major and minor versions must be integers') self._refresh_conn = True @@ -228,8 +228,8 @@ class NaServer(object): if self._trace: LOG.debug("Request: %s", request_element.to_string(pretty=True)) - if not hasattr(self, '_opener') or not self._opener \ - or self._refresh_conn: + if (not hasattr(self, '_opener') or not self._opener + or self._refresh_conn): self._build_opener() try: if hasattr(self, '_timeout'): @@ -262,15 +262,15 @@ class NaServer(object): result = self.invoke_elem(na_element, enable_tunneling) if result.has_attr('status') and result.get_attr('status') == 'passed': return result - code = result.get_attr('errno')\ - or result.get_child_content('errorno')\ - or 'ESTATUSFAILED' + code = (result.get_attr('errno') + or result.get_child_content('errorno') + or 'ESTATUSFAILED') if code == ESIS_CLONE_NOT_LICENSED: msg = 'Clone operation failed: FlexClone not licensed.' else: - msg = result.get_attr('reason')\ - or result.get_child_content('reason')\ - or 'Execution status is failed due to unknown reason' + msg = (result.get_attr('reason') + or result.get_child_content('reason') + or 'Execution status is failed due to unknown reason') raise NaApiError(code, msg) def _create_request(self, na_element, enable_tunneling=False): @@ -291,19 +291,19 @@ class NaServer(object): def _enable_tunnel_request(self, netapp_elem): """Enables vserver or vfiler tunneling.""" if hasattr(self, '_vfiler') and self._vfiler: - if hasattr(self, '_api_major_version') and \ - hasattr(self, '_api_minor_version') and \ - self._api_major_version >= 1 and \ - self._api_minor_version >= 7: + if (hasattr(self, '_api_major_version') and + hasattr(self, '_api_minor_version') and + self._api_major_version >= 1 and + self._api_minor_version >= 7): netapp_elem.add_attr('vfiler', self._vfiler) else: raise ValueError('ontapi version has to be atleast 1.7' ' to send request to vfiler') if hasattr(self, '_vserver') and self._vserver: - if hasattr(self, '_api_major_version') and \ - hasattr(self, '_api_minor_version') and \ - self._api_major_version >= 1 and \ - self._api_minor_version >= 15: + if (hasattr(self, '_api_major_version') and + hasattr(self, '_api_minor_version') and + self._api_major_version >= 1 and + self._api_minor_version >= 15): netapp_elem.add_attr('vfiler', self._vserver) else: raise ValueError('ontapi version has to be atleast 1.15' diff --git a/manila/share/drivers/netapp/dataontap/client/client_cmode.py b/manila/share/drivers/netapp/dataontap/client/client_cmode.py index 1cb447e0f5..6522fec87b 100644 --- a/manila/share/drivers/netapp/dataontap/client/client_cmode.py +++ b/manila/share/drivers/netapp/dataontap/client/client_cmode.py @@ -1368,9 +1368,9 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): @na_utils.trace def _get_kerberos_service_principal_name(self, security_service, vserver_name): - return 'nfs/' + vserver_name.replace('_', '-') + '.' + \ - security_service['domain'] + '@' + \ - security_service['domain'].upper() + return ('nfs/' + vserver_name.replace('_', '-') + '.' + + security_service['domain'] + '@' + + security_service['domain'].upper()) @na_utils.trace def configure_dns(self, security_service): diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py index 7dafd814af..9906537ead 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py @@ -63,8 +63,8 @@ class NetAppCmodeMultiSVMFileStorageLibrary( 'netapp_aggregate_name_search_pattern is set correctly.') raise exception.NetAppException(msg) - super(NetAppCmodeMultiSVMFileStorageLibrary, self).\ - check_for_setup_error() + (super(NetAppCmodeMultiSVMFileStorageLibrary, self). + check_for_setup_error()) @na_utils.trace def _get_vserver(self, share_server=None): @@ -102,8 +102,8 @@ class NetAppCmodeMultiSVMFileStorageLibrary( self._client.prune_deleted_nfs_export_policies() self._client.prune_deleted_snapshots() - super(NetAppCmodeMultiSVMFileStorageLibrary, self).\ - _handle_housekeeping_tasks() + (super(NetAppCmodeMultiSVMFileStorageLibrary, self). + _handle_housekeeping_tasks()) @na_utils.trace def _find_matching_aggregates(self): diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_single_svm.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_single_svm.py index af6b896c86..aca78f2c7d 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_single_svm.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_single_svm.py @@ -79,8 +79,8 @@ class NetAppCmodeSingleSVMFileStorageLibrary( else 'Vserver') LOG.info(msg % msg_args) - super(NetAppCmodeSingleSVMFileStorageLibrary, self).\ - check_for_setup_error() + (super(NetAppCmodeSingleSVMFileStorageLibrary, self). + check_for_setup_error()) @na_utils.trace def _get_vserver(self, share_server=None): @@ -115,8 +115,8 @@ class NetAppCmodeSingleSVMFileStorageLibrary( vserver_client.prune_deleted_nfs_export_policies() vserver_client.prune_deleted_snapshots() - super(NetAppCmodeSingleSVMFileStorageLibrary, self).\ - _handle_housekeeping_tasks() + (super(NetAppCmodeSingleSVMFileStorageLibrary, self). + _handle_housekeeping_tasks()) @na_utils.trace def _find_matching_aggregates(self): diff --git a/manila/share/drivers/zfssa/restclient.py b/manila/share/drivers/zfssa/restclient.py index 47e801387c..df1bc14a24 100644 --- a/manila/share/drivers/zfssa/restclient.py +++ b/manila/share/drivers/zfssa/restclient.py @@ -181,8 +181,8 @@ class RestClientURL(object): # pylint: disable=R0902 result = self.post("/access/v1") del self.headers['authorization'] if result.status == http_client.CREATED: - self.headers['x-auth-session'] = \ - result.get_header('x-auth-session') + self.headers['x-auth-session'] = ( + result.get_header('x-auth-session')) self.do_logout = True log_debug_msg(self, ('ZFSSA version: %s') % result.get_header('x-zfssa-version'))