Merge "Fix deprecation escape sequence errors under 3.6"

This commit is contained in:
Zuul 2019-04-09 20:10:37 +00:00 committed by Gerrit Code Review
commit 225814ecf3
4 changed files with 12 additions and 12 deletions

View File

@ -417,12 +417,12 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase):
def _get_regexes(self):
text = r'(\\"|[^"])*'
isotime_re = '\d{4}-[0,1]\d-[0-3]\dT\d{2}:\d{2}:\d{2}Z'
strtime_re = '\d{4}-[0,1]\d-[0-3]\dT\d{2}:\d{2}:\d{2}\.\d{6}'
isotime_re = r'\d{4}-[0,1]\d-[0-3]\dT\d{2}:\d{2}:\d{2}Z'
strtime_re = r'\d{4}-[0,1]\d-[0-3]\dT\d{2}:\d{2}:\d{2}\.\d{6}'
extension_update = (
'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}')
strtime_url_re = ('\d{4}-[0,1]\d-[0-3]\d'
'\+\d{2}\%3A\d{2}\%3A\d{2}\.\d{6}')
r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}')
strtime_url_re = (r'\d{4}-[0,1]\d-[0-3]\d'
r'\+\d{2}\%3A\d{2}\%3A\d{2}\.\d{6}')
return {
'isotime': isotime_re,
@ -436,7 +436,7 @@ class ApiSampleTestBase(functional_helpers._FunctionalTestBase):
'-[0-9a-f]{4}-[0-9a-f]{12}',
'request_id': 'req-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}'
'-[0-9a-f]{4}-[0-9a-f]{12}',
'host': 'https?://[0-9]+(?:\.[0-9]+){3}:[0-9]+',
'host': r'https?://[0-9]+(?:\.[0-9]+){3}:[0-9]+',
'host_name': r'\w+',
'glance_host': self._get_glance_host(),
'os-vol-host-attr:host': self.volume.host,

View File

@ -30,18 +30,18 @@ class FakeSession(test_utils.FakeBaseSession):
'/storagePool$':
{'storagePools': [{'poolName': 'fake_pool_name',
'poolId': 'fake_pool_id'}]},
'/storagePool\?poolId=0':
r'/storagePool\?poolId=0':
{'storagePools': [{'poolName': 'fake_pool_name1',
'poolId': 0}]},
'/volume/queryByName\?volName=fake_name':
r'/volume/queryByName\?volName=fake_name':
{'errorCode': 0, 'lunDetailInfo':
[{'volume_id': 'fake_id',
'volume_name': 'fake_name'}]},
'/volume/queryById\?volId=fake_id':
r'/volume/queryById\?volId=fake_id':
{'errorCode': 0, 'lunDetailInfo':
[{'volume_id': 'fake_id',
'volume_name': 'fake_name'}]},
'/lun/wwn/list\?wwn=fake_wwn':
r'/lun/wwn/list\?wwn=fake_wwn':
{'errorCode': 0, 'lunDetailInfo':
[{'volume_id': 'fake_id',
'volume_wwn': 'fake_wwn'}]},

View File

@ -328,7 +328,7 @@ class HuaweiConf(object):
if ini_type in dev:
# Analyze initiators configure text, convert to:
# [{'Name':'xxx'}, {'Name':'xxx','CHAPinfo':'mm-usr#mm-pwd'}]
ini_list = re.split('\s', dev[ini_type])
ini_list = re.split(r'\s', dev[ini_type])
def _convert_one_iscsi_info(ini_text):
# get initiator configure attr list

View File

@ -372,7 +372,7 @@ def get_export_host_junction_path(share):
if '[' in share and ']' in share:
try:
# ipv6
host = re.search('\[(.*)\]', share).group(1)
host = re.search(r'\[(.*)\]', share).group(1)
junction_path = share.split(':')[-1]
except AttributeError:
raise exception.NetAppDriverException(_("Share '%s' is "