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 <viroel@gmail.com>
This commit is contained in:
Douglas Viroel 2020-09-19 07:10:34 -03:00
parent 5f433b59ba
commit 40b12b23af
2 changed files with 9 additions and 1 deletions

View File

@ -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",

View File

@ -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 <https://bugs.launchpad.net/manila/+bug/1896322>`_ for more
details.