LOG.error("getDHCPServerPort: neutron port of {} is not found", neutronPortId);
return null;
}
+ /* if the current port is a DHCP port, return the same*/
+ if (neutronPort.getDeviceOwner().contains("dhcp")) {
+ return neutronPort;
+ }
/*Since all the fixed ip assigned to a port should be
*from the same network, first port is sufficient.*/
List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs();
Constants.EXTERNAL_ID_INTERFACE_ID);
if (null != portId) {
NeutronPort port = neutronPortCache.getPort(portId);
- if (null != port) {
- if (!(port.getID().equals(neutronPort.getID()))
- && port.getDeviceOwner().contains("compute")) {
- List<Neutron_IPs> portFixedIp = port.getFixedIPs();
- if (null == portFixedIp || portFixedIp.isEmpty()) {
- return false;
- }
- if (portFixedIp.iterator().next().getSubnetUUID()
- .equals(neutronPort.getFixedIPs().iterator().next().getSubnetUUID())) {
- LOG.trace("isLastPortinSubnet: Port is not the only port.");
- return false;
- }
+ if (null != port && !(port.getID().equals(neutronPort.getID()))
+ && port.getDeviceOwner().contains("compute")) {
+ List<Neutron_IPs> portFixedIp = port.getFixedIPs();
+ if (null == portFixedIp || portFixedIp.isEmpty()) {
+ return false;
+ }
+ if (portFixedIp.iterator().next().getSubnetUUID()
+ .equals(neutronPort.getFixedIPs().iterator().next().getSubnetUUID())) {
+ LOG.trace("isLastPortinSubnet: Port is not the only port.");
+ return false;
}
}
}
for (TerminationPoint tp : terminationPoints) {
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
- if (null != ovsdbTerminationPointAugmentation) {
- if (!(ovsdbTerminationPointAugmentation.getName().equals(Constants.INTEGRATION_BRIDGE))
- && !(terminationPointAugmentation.getInterfaceUuid()
- .equals(ovsdbTerminationPointAugmentation.getInterfaceUuid()))) {
- LOG.debug("isLastPortinBridge: it the last port in bridge {}",
- terminationPointAugmentation.getName());
- return false;
- }
+ if (null != ovsdbTerminationPointAugmentation
+ && !(ovsdbTerminationPointAugmentation.getName().equals(Constants.INTEGRATION_BRIDGE))
+ && !(terminationPointAugmentation.getInterfaceUuid()
+ .equals(ovsdbTerminationPointAugmentation.getInterfaceUuid()))) {
+ LOG.debug("isLastPortinBridge: it the last port in bridge {}",
+ terminationPointAugmentation.getName());
+ return false;
}
}
}