From 2259967e3c3a9ec7a97a5cbed62e474083eed66e Mon Sep 17 00:00:00 2001 From: Jan Gutter Date: Wed, 6 Feb 2019 10:13:10 +0200 Subject: [PATCH] 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 --- vif_plug_ovs/linux_net.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vif_plug_ovs/linux_net.py b/vif_plug_ovs/linux_net.py index 689a4e1b..385eabd9 100644 --- a/vif_plug_ovs/linux_net.py +++ b/vif_plug_ovs/linux_net.py @@ -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 :. -PF_FUNC_RE = re.compile("\.(\d+)", 0) +PF_FUNC_RE = re.compile(r"\.(\d+)", 0) _SRIOV_TOTALVFS = "sriov_totalvfs"