[Bug 1498370] [NEW] [SRU] DHCP agent: interface unplug leads to exception

Launchpad Bug Tracker 1498370 at bugs.launchpad.net
Mon Nov 23 20:27:36 UTC 2015


You have been subscribed to a public bug by Mathew Hodson (mathew-hodson):

[Impact]

    There are edge cases when the DHCP agent attempts to unplug an interface
    and the device does not exist. This patch ensures that the agent can
    tolerate this case.

[Test Case]

    * create subnet with dhcp enabled
    * set pdb.set_trace() in neutron.agent.linux.dhcp.DeviceManager.destroy()
    * manually delete ns-<id> device in tenant namespace
    * pdb continue and should not raise any error

[Regression Potential]

    None

2015-09-22 01:23:42.612 ERROR neutron.agent.dhcp.agent [-] Unable to disable dhcp for c543db4d-e077-488f-b58c-5805f63f86b6.
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent Traceback (most recent call last):
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent   File "/opt/stack/neutron/neutron/agent/dhcp/agent.py", line 115, in call_driver
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent     getattr(driver, action)(**action_kwargs)
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent   File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 221, in disable
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent     self._destroy_namespace_and_port()
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent   File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 226, in _destroy_namespace_and_port
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent     self.device_manager.destroy(self.network, self.interface_name)
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent   File "/opt/stack/neutron/neutron/agent/linux/dhcp.py", line 1223, in destroy
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent     self.driver.unplug(device_name, namespace=network.namespace)
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent   File "/opt/stack/neutron/neutron/agent/linux/interface.py", line 358, in unplug
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent     tap_name = self._get_tap_name(device_name, prefix)
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent   File "/opt/stack/neutron/neutron/agent/linux/interface.py", line 299, in _get_tap_name
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent     dev_name = dev_name.replace(prefix or self.DEV_NAME_PREFIX,
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent AttributeError: 'NoneType' object has no attribute 'replace'
2015-09-22 01:23:42.612 TRACE neutron.agent.dhcp.agent
2015-09-22 01:23:42.616 INFO neutron.agent.dhcp.agent [-] Synchronizing state complete

The reason is the device is None

** Affects: neutron
     Importance: High
     Assignee: Gary Kotton (garyk)
         Status: Fix Released

** Affects: neutron (Ubuntu)
     Importance: High
         Status: Fix Released

** Affects: neutron (Ubuntu Trusty)
     Importance: High
         Status: New

** Affects: neutron (Ubuntu Vivid)
     Importance: High
     Assignee: Edward Hope-Morley (hopem)
         Status: In Progress

** Affects: neutron (Ubuntu Wily)
     Importance: High
         Status: Fix Released

** Affects: neutron (Ubuntu Xenial)
     Importance: High
         Status: Fix Released


** Tags: in-stable-kilo in-stable-liberty kilo-backport-potential patch
-- 
[SRU] DHCP agent: interface unplug leads to exception
https://bugs.launchpad.net/bugs/1498370
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list