From 40b12b23af17a70d22780dfefe1c6689698f9693 Mon Sep 17 00:00:00 2001 From: Douglas Viroel Date: Sat, 19 Sep 2020 07:10:34 -0300 Subject: [PATCH] Fix manage share server for container in Focal While managing share server using newest versions of the Open vSwitch, some of the interface external-ids are being saved without quotation marks around the container name. This causes the regex to fail on filtering the correct network interface and fail on manage share server operation. An alternative would be to always set the quotation mark around the container name, but this is not accepted and dropped by the Open vSwitch. Instead, the search regex was updated and now it accepts both modes: i) manila-container=manila_85fd0ad7_f614_46e3_bad3_f19eae36f6ea ii) manila-container="manila_85fd0ad7_f614_46e3_bad3_f19eae36f6ea" Closes-Bug: #1896322 Change-Id: Ia24e7cd186cfa23fdfb267ce9b6155ff3d93d5d2 Signed-off-by: Douglas Viroel --- manila/share/drivers/container/container_helper.py | 2 +- ...-container-fix-search-veth-regex-7f2156a6fd411bdb.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-1896322-container-fix-search-veth-regex-7f2156a6fd411bdb.yaml diff --git a/manila/share/drivers/container/container_helper.py b/manila/share/drivers/container/container_helper.py index 81bd3daeb7..7938431820 100644 --- a/manila/share/drivers/container/container_helper.py +++ b/manila/share/drivers/container/container_helper.py @@ -149,7 +149,7 @@ class DockerExecHelper(driver.ExecuteMixin): interfaces = self._execute("ovs-vsctl", "list", "interface", run_as_root=True)[0] veths = set(re.findall("veth[0-9a-zA-Z]{7}", interfaces)) - manila_re = "manila-container=\".*\"" + manila_re = "manila-container=\"?.{%s}\"?" % len(name) for veth in veths: try: iface_data = self._execute("ovs-vsctl", "list", "interface", diff --git a/releasenotes/notes/bug-1896322-container-fix-search-veth-regex-7f2156a6fd411bdb.yaml b/releasenotes/notes/bug-1896322-container-fix-search-veth-regex-7f2156a6fd411bdb.yaml new file mode 100644 index 0000000000..ce16468b59 --- /dev/null +++ b/releasenotes/notes/bug-1896322-container-fix-search-veth-regex-7f2156a6fd411bdb.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixed an issue on Container driver when managing share servers. The regex + used to search for container-name in the available network interfaces + was updated to support newer versions of Open vSwitch. Refer to the + `Bug #1896322 `_ for more + details.