diff --git a/cinder/tests/functional/api_samples_test_base.py b/cinder/tests/functional/api_samples_test_base.py index 6d72d581d17..8e9346cb6a3 100644 --- a/cinder/tests/functional/api_samples_test_base.py +++ b/cinder/tests/functional/api_samples_test_base.py @@ -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, diff --git a/cinder/tests/unit/volume/drivers/fusionstorage/test_fs_client.py b/cinder/tests/unit/volume/drivers/fusionstorage/test_fs_client.py index 842e00d4ba3..e5d620ba8e4 100644 --- a/cinder/tests/unit/volume/drivers/fusionstorage/test_fs_client.py +++ b/cinder/tests/unit/volume/drivers/fusionstorage/test_fs_client.py @@ -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'}]}, diff --git a/cinder/volume/drivers/huawei/huawei_conf.py b/cinder/volume/drivers/huawei/huawei_conf.py index 537737b13f3..7ff8091444c 100644 --- a/cinder/volume/drivers/huawei/huawei_conf.py +++ b/cinder/volume/drivers/huawei/huawei_conf.py @@ -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 diff --git a/cinder/volume/drivers/netapp/utils.py b/cinder/volume/drivers/netapp/utils.py index 94f756addf0..6b1177398f1 100644 --- a/cinder/volume/drivers/netapp/utils.py +++ b/cinder/volume/drivers/netapp/utils.py @@ -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 "