[NEUTRON-31] On a router_interface_add, the Northbound code assumed (incorrectly) the port has null device_id and device_owner Created: 17/Apr/15  Updated: 11/Jun/15  Resolved: 11/Jun/15

Status: Resolved
Project: neutron
Component/s: General
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Kyle Mestery Assignee: Rajesh Jaiswal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3014

 Description   

This was found while integrating with the router_interface_add/remove calls from OpenStack.



 Comments   
Comment by Rajesh Jaiswal [ 07/May/15 ]

As per northbound code the device_Id and device_Owner on router_interface_add does not looks that it assumes (incorrectly) the port has null device_id and device_owner .Please look at the following code ..

if (targetPort.getDeviceID() != null && !targetPort.getDeviceID().equals(routerUUID))
throw new ResourceConflictException("Target Port already allocated to a different device id");
if (targetPort.getDeviceOwner() != null &&
!targetPort.getDeviceOwner().equalsIgnoreCase(ROUTER_INTERFACE_STR))
throw new ResourceConflictException("Target Port already allocated to non-router interface");

/////////////////////////

//mark the port device id and device owner fields
if (targetPort.getDeviceOwner() == null || targetPort.getDeviceOwner().isEmpty())
targetPort.setDeviceOwner(ROUTER_INTERFACE_STR);
targetPort.setDeviceID(routerUUID);

Comment by Ryan Moats [ 09/Jun/15 ]

https://git.opendaylight.org/gerrit/#/c/22220 adds tests to address this defect in master branch

https://git.opendaylight.org/gerrit/#/c/22222 does the same for the stable/lithium branch

Comment by Flavio Fernandes [ 09/Jun/15 ]

Merge to Helium via this gerrit:

https://git.opendaylight.org/gerrit/22227

Generated at Wed Feb 07 20:25:22 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.