yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #26718
[Bug 1408909] [NEW] Release_dhcp_port doesn't work when remove network from dhcp agent
Public bug reported:
In the bug:https://bugs.launchpad.net/neutron/+bug/1288923
It changes that reserve the dhcp port to be reused after remove-network-from-agent.
The code is:
port['device_id'] = constants.DEVICE_ID_RESERVED_DHCP_PORT
self.update_port(context, port['id'], dict(port=port))
Then the code will be executed to release_dhcp_port. The above port device_id in the database has been modified, so it can't release the dhcp port.
def delete_ports_by_device_id(self, context, device_id, network_id=None):
query = (context.session.query(models_v2.Port.id)
.enable_eagerloads(False)
.filter(models_v2.Port.device_id == device_id))
if network_id:
query = query.filter(models_v2.Port.network_id == network_id)
port_ids = [p[0] for p in query]
for port_id in port_ids:
try:
self.delete_port(context, port_id)
The "port_ids" will be none,so the release_dhcp_port doesn't work.It seems inappropriate.
I think if we want to reserve the dhcp port,we do not need "release_dhcp_port", so delete it.
Or we have other ways of handling here.
** Affects: neutron
Importance: Undecided
Assignee: KaiLin (linkai3)
Status: New
** Changed in: neutron
Assignee: (unassigned) => KaiLin (linkai3)
** Summary changed:
- Release_dhcp_port doesn't work when When remove network from dhcp agent
+ Release_dhcp_port doesn't work when remove network from dhcp agent
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1408909
Title:
Release_dhcp_port doesn't work when remove network from dhcp agent
Status in OpenStack Neutron (virtual network service):
New
Bug description:
In the bug:https://bugs.launchpad.net/neutron/+bug/1288923
It changes that reserve the dhcp port to be reused after remove-network-from-agent.
The code is:
port['device_id'] = constants.DEVICE_ID_RESERVED_DHCP_PORT
self.update_port(context, port['id'], dict(port=port))
Then the code will be executed to release_dhcp_port. The above port device_id in the database has been modified, so it can't release the dhcp port.
def delete_ports_by_device_id(self, context, device_id, network_id=None):
query = (context.session.query(models_v2.Port.id)
.enable_eagerloads(False)
.filter(models_v2.Port.device_id == device_id))
if network_id:
query = query.filter(models_v2.Port.network_id == network_id)
port_ids = [p[0] for p in query]
for port_id in port_ids:
try:
self.delete_port(context, port_id)
The "port_ids" will be none,so the release_dhcp_port doesn't work.It seems inappropriate.
I think if we want to reserve the dhcp port,we do not need "release_dhcp_port", so delete it.
Or we have other ways of handling here.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1408909/+subscriptions
Follow ups
References