Fix nits in brctl removal (vif_plug_linux_bridge)
This commit fixes the nits caught in: Id03be72e22302a0954f3e47c116f389cb4304c03 Change-Id: Ib7fcb3c6f809222c33d163fe7a2d854016c7d392 Signed-off-by: Jan Gutter <jan.gutter@netronome.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
other:
|
other:
|
||||||
- |
|
- |
|
||||||
With this release, packagers of ``os-vif`` no longer need to create a
|
With this release, packagers of ``os-vif`` no longer need to create a
|
||||||
depency on ``brctl``. ``brctl`` is largely considered obsolete and has
|
dependency on ``brctl``. ``brctl`` is largely considered obsolete and has
|
||||||
been replaced with iproute2 by default in many linux distributions.
|
been replaced with iproute2 by default in many linux distributions.
|
||||||
RHEL 8 will not ship ``brctl`` in its default repos. As part of a larger
|
RHEL 8 will not ship ``brctl`` in its default repos. As part of a larger
|
||||||
effort to remove usage of ``brctl`` from OpenStack ``os-vif`` has
|
effort to remove usage of ``brctl`` from OpenStack ``os-vif`` has
|
||||||
|
|||||||
@@ -102,8 +102,11 @@ def _disable_ipv6(bridge):
|
|||||||
privsep context.
|
privsep context.
|
||||||
:param bridge: string bridge name
|
:param bridge: string bridge name
|
||||||
"""
|
"""
|
||||||
disv6 = ('/proc/sys/net/ipv6/conf/%s/disable_ipv6' %
|
# NOTE(sean-k-mooney): os-vif disables ipv6 to ensure the Bridge
|
||||||
bridge)
|
# does not aquire an ipv6 auto config or link local adress.
|
||||||
|
# This is required to prevent bug 1302080.
|
||||||
|
# https://bugs.launchpad.net/neutron/+bug/1302080
|
||||||
|
disv6 = ('/proc/sys/net/ipv6/conf/%s/disable_ipv6' % bridge)
|
||||||
if os.path.exists(disv6):
|
if os.path.exists(disv6):
|
||||||
with open(disv6, 'w') as f:
|
with open(disv6, 'w') as f:
|
||||||
f.write('1')
|
f.write('1')
|
||||||
@@ -123,15 +126,16 @@ def _update_bridge_routes(interface, bridge):
|
|||||||
# NOTE(danms): We also need to copy routes to the bridge so as
|
# NOTE(danms): We also need to copy routes to the bridge so as
|
||||||
# not to break existing connectivity on the interface
|
# not to break existing connectivity on the interface
|
||||||
old_routes = []
|
old_routes = []
|
||||||
out, err = processutils.execute('ip', 'route', 'show', 'dev',
|
out, _ = processutils.execute('ip', 'route', 'show', 'dev',
|
||||||
interface)
|
interface)
|
||||||
for line in out.split('\n'):
|
for line in out.split('\n'):
|
||||||
fields = line.split()
|
fields = line.split()
|
||||||
if fields and 'via' in fields:
|
if fields and 'via' in fields:
|
||||||
old_routes.append(fields)
|
old_routes.append(fields)
|
||||||
processutils.execute('ip', 'route', 'del', *fields)
|
processutils.execute('ip', 'route', 'del', *fields)
|
||||||
out, err = processutils.execute('ip', 'addr', 'show', 'dev',
|
|
||||||
interface, 'scope', 'global')
|
out, _ = processutils.execute('ip', 'addr', 'show', 'dev',
|
||||||
|
interface, 'scope', 'global')
|
||||||
for line in out.split('\n'):
|
for line in out.split('\n'):
|
||||||
fields = line.split()
|
fields = line.split()
|
||||||
if fields and fields[0] == 'inet':
|
if fields and fields[0] == 'inet':
|
||||||
|
|||||||
@@ -120,8 +120,7 @@ class LinuxNetTest(testtools.TestCase):
|
|||||||
followed by the bridge. This is required to work around
|
followed by the bridge. This is required to work around
|
||||||
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064
|
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064
|
||||||
"""
|
"""
|
||||||
mock_dev_exists.return_value = next(lambda: (yield False),
|
mock_dev_exists.side_effect = [False, True]
|
||||||
(yield True))
|
|
||||||
linux_net._ensure_bridge_privileged("fake-bridge", "fake-interface",
|
linux_net._ensure_bridge_privileged("fake-bridge", "fake-interface",
|
||||||
None, False, mtu=1500)
|
None, False, mtu=1500)
|
||||||
calls = [mock.call('fake-interface', 1500),
|
calls = [mock.call('fake-interface', 1500),
|
||||||
|
|||||||
Reference in New Issue
Block a user