diff --git a/releasenotes/notes/brctl-removal-a5b0e69b865afa57.yaml b/releasenotes/notes/brctl-removal-a5b0e69b865afa57.yaml index b093b5e1..3d258062 100644 --- a/releasenotes/notes/brctl-removal-a5b0e69b865afa57.yaml +++ b/releasenotes/notes/brctl-removal-a5b0e69b865afa57.yaml @@ -2,7 +2,7 @@ other: - | 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. 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 diff --git a/vif_plug_linux_bridge/linux_net.py b/vif_plug_linux_bridge/linux_net.py index 66217c34..dee421e1 100644 --- a/vif_plug_linux_bridge/linux_net.py +++ b/vif_plug_linux_bridge/linux_net.py @@ -102,8 +102,11 @@ def _disable_ipv6(bridge): privsep context. :param bridge: string bridge name """ - disv6 = ('/proc/sys/net/ipv6/conf/%s/disable_ipv6' % - bridge) + # NOTE(sean-k-mooney): os-vif disables ipv6 to ensure the 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): with open(disv6, 'w') as f: 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 # not to break existing connectivity on the interface old_routes = [] - out, err = processutils.execute('ip', 'route', 'show', 'dev', - interface) + out, _ = processutils.execute('ip', 'route', 'show', 'dev', + interface) for line in out.split('\n'): fields = line.split() if fields and 'via' in fields: old_routes.append(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'): fields = line.split() if fields and fields[0] == 'inet': diff --git a/vif_plug_linux_bridge/tests/unit/test_linux_net.py b/vif_plug_linux_bridge/tests/unit/test_linux_net.py index e909c5ac..a5b68b7b 100644 --- a/vif_plug_linux_bridge/tests/unit/test_linux_net.py +++ b/vif_plug_linux_bridge/tests/unit/test_linux_net.py @@ -120,8 +120,7 @@ class LinuxNetTest(testtools.TestCase): followed by the bridge. This is required to work around https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064 """ - mock_dev_exists.return_value = next(lambda: (yield False), - (yield True)) + mock_dev_exists.side_effect = [False, True] linux_net._ensure_bridge_privileged("fake-bridge", "fake-interface", None, False, mtu=1500) calls = [mock.call('fake-interface', 1500),