Merge "Add debug logs to OVSInterfaceDriver.plug_new"
This commit is contained in:
commit
8aea971574
@ -411,6 +411,9 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
|
|||||||
root_dev.disable_ipv6()
|
root_dev.disable_ipv6()
|
||||||
else:
|
else:
|
||||||
ns_dev = ip.device(device_name)
|
ns_dev = ip.device(device_name)
|
||||||
|
if not ns_dev:
|
||||||
|
LOG.warning("Device %s is not ready in namespace %s!",
|
||||||
|
device_name, namespace)
|
||||||
|
|
||||||
internal = not self.conf.ovs_use_veth
|
internal = not self.conf.ovs_use_veth
|
||||||
self._ovs_add_port(bridge, tap_name, port_id, mac_address,
|
self._ovs_add_port(bridge, tap_name, port_id, mac_address,
|
||||||
@ -439,6 +442,13 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
|
|||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
ovs = ovs_lib.OVSBridge(bridge)
|
ovs = ovs_lib.OVSBridge(bridge)
|
||||||
ovs.delete_port(tap_name)
|
ovs.delete_port(tap_name)
|
||||||
|
except Exception as exc:
|
||||||
|
LOG.warning("Failed to plug interface %s to bridge %s in "
|
||||||
|
"namespace %s due to unknown reason: %s",
|
||||||
|
device_name, bridge, namespace, str(exc))
|
||||||
|
with excutils.save_and_reraise_exception():
|
||||||
|
ovs = ovs_lib.OVSBridge(bridge)
|
||||||
|
ovs.delete_port(tap_name)
|
||||||
|
|
||||||
# NOTE(ihrachys): the order here is significant: we must set MTU after
|
# NOTE(ihrachys): the order here is significant: we must set MTU after
|
||||||
# the device is moved into a namespace, otherwise OVS bridge does not
|
# the device is moved into a namespace, otherwise OVS bridge does not
|
||||||
|
@ -463,6 +463,7 @@ class TestOVSInterfaceDriver(TestBase):
|
|||||||
expected = [
|
expected = [
|
||||||
mock.call(),
|
mock.call(),
|
||||||
mock.call().device('tap0'),
|
mock.call().device('tap0'),
|
||||||
|
mock.ANY,
|
||||||
mock.call().device().link.set_address('aa:bb:cc:dd:ee:ff'),
|
mock.call().device().link.set_address('aa:bb:cc:dd:ee:ff'),
|
||||||
mock.call().device().link.set_address('aa:bb:cc:dd:ee:ff')]
|
mock.call().device().link.set_address('aa:bb:cc:dd:ee:ff')]
|
||||||
if namespace:
|
if namespace:
|
||||||
|
Loading…
Reference in New Issue
Block a user