Py3: Fix invalid escape sequencees

These throw warnings on Python 3.6.

Change-Id: If46e59792423b384bbb2d46c05ac0b57df06254b
This commit is contained in:
Eric Harney 2019-02-21 14:31:15 -05:00
parent fb5ebc2f9e
commit 8938733ba8
3 changed files with 6 additions and 6 deletions

View File

@ -24,8 +24,8 @@ import re
DEVICE_SCAN_ATTEMPTS_DEFAULT = 3
MULTIPATH_ERROR_REGEX = re.compile("\w{3} \d+ \d\d:\d\d:\d\d \|.*$")
MULTIPATH_PATH_CHECK_REGEX = re.compile("\s+\d+:\d+:\d+:\d+\s+")
MULTIPATH_ERROR_REGEX = re.compile(r"\w{3} \d+ \d\d:\d\d:\d\d \|.*$")
MULTIPATH_PATH_CHECK_REGEX = re.compile(r"\s+\d+:\d+:\d+:\d+\s+")
PLATFORM_ALL = 'ALL'
PLATFORM_x86 = 'X86'

View File

@ -32,8 +32,8 @@ from os_brick import utils
LOG = logging.getLogger(__name__)
MULTIPATH_ERROR_REGEX = re.compile("\w{3} \d+ \d\d:\d\d:\d\d \|.*$")
MULTIPATH_WWID_REGEX = re.compile("\((?P<wwid>.+)\)")
MULTIPATH_ERROR_REGEX = re.compile(r"\w{3} \d+ \d\d:\d\d:\d\d \|.*$")
MULTIPATH_WWID_REGEX = re.compile(r"\((?P<wwid>.+)\)")
MULTIPATH_DEVICE_ACTIONS = ['unchanged:', 'reject:', 'reload:',
'switchpg:', 'rename:', 'create:',
'resize:']

View File

@ -158,7 +158,7 @@ class RemoteFsClient(executor.Executor):
def _check_nfs_options(self):
"""Checks and prepares nfs mount type options."""
self._nfs_mount_type_opts = {'nfs': self._mount_options}
nfs_vers_opt_patterns = ['^nfsvers', '^vers', '^v[\d]']
nfs_vers_opt_patterns = ['^nfsvers', '^vers', r'^v[\d]']
for opt in nfs_vers_opt_patterns:
if self._option_exists(self._mount_options, opt):
return
@ -246,7 +246,7 @@ class VZStorageRemoteFSClient(RemoteFsClient):
def _do_mount(self, mount_type, vz_share, mount_path,
mount_options=None, flags=None):
m = re.search("(?:(\S+):\/)?([a-zA-Z0-9_-]+)(?::(\S+))?", vz_share)
m = re.search(r"(?:(\S+):\/)?([a-zA-Z0-9_-]+)(?::(\S+))?", vz_share)
if not m:
msg = (_("Invalid Virtuozzo Storage share specification: %r."
"Must be: [MDS1[,MDS2],...:/]<CLUSTER NAME>[:PASSWORD].")