Merge "Use parenthesis instead of backslashes in share folder"

This commit is contained in:
Jenkins 2017-06-19 11:58:09 +00:00 committed by Gerrit Code Review
commit 52084ee4f1
6 changed files with 34 additions and 34 deletions

View File

@ -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)

View File

@ -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'

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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'))