Convert hardcoded regexes to raw strings for py36

From the Python 3.6 release notes:

A backslash-character pair that is not a valid escape sequence now
generates a DeprecationWarning. Although this will eventually become a
SyntaxError, that will not be for several Python releases. (Contributed
by Emanuel Barry in bpo-27364.) [1]

This patch converts the remaining regexes in the ovs plugin to raw.

[1]: https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

Change-Id: I640d636cb602de543e942ad7f2339e63a487a43b
Signed-off-by: Jan Gutter <jan.gutter@netronome.com>
This commit is contained in:
Jan Gutter 2019-02-06 10:13:10 +02:00
parent 192d6fd114
commit 2259967e3c
1 changed files with 5 additions and 5 deletions

View File

@ -35,16 +35,16 @@ from vif_plug_ovs import privsep
LOG = logging.getLogger(__name__)
VIRTFN_RE = re.compile("virtfn(\d+)")
VIRTFN_RE = re.compile(r"virtfn(\d+)")
# phys_port_name only contains the VF number
INT_RE = re.compile("^(\d+)$")
INT_RE = re.compile(r"^(\d+)$")
# phys_port_name contains VF## or vf##
VF_RE = re.compile("vf(\d+)", re.IGNORECASE)
VF_RE = re.compile(r"vf(\d+)", re.IGNORECASE)
# phys_port_name contains PF## or pf##
PF_RE = re.compile("pf(\d+)", re.IGNORECASE)
PF_RE = re.compile(r"pf(\d+)", re.IGNORECASE)
# bus_info (bdf) contains <bus>:<dev>.<func>
PF_FUNC_RE = re.compile("\.(\d+)", 0)
PF_FUNC_RE = re.compile(r"\.(\d+)", 0)
_SRIOV_TOTALVFS = "sriov_totalvfs"