LOG.error("getDHCPServerPort:getDHCPServerPort failed due to ", e);
return null;
}
-
return null;
+ }
+ @Override
+ public NeutronPort getNeutronPortFromDhcpIntf(
+ OvsdbTerminationPointAugmentation terminationPointAugmentation) {
+ if (neutronPortCache == null) {
+ LOG.error("getNeutronPortFromDhcpIntf: neutron port is null");
+ return null;
+ }
+ String neutronPortId = southbound.getInterfaceExternalIdsValue(
+ terminationPointAugmentation,
+ Constants.EXTERNAL_ID_INTERFACE_ID);
+ if (neutronPortId == null) {
+ return null;
+ }
+ NeutronPort neutronPort = neutronPortCache.getPort(neutronPortId);
+ if (neutronPort == null) {
+ LOG.error("getNeutronPortFromDhcpIntf: neutron port of {} is not found", neutronPortId);
+ return null;
+ }
+ /* if the current port is a DHCP port, return true*/
+ if (neutronPort.getDeviceOwner().contains("dhcp")) {
+ LOG.trace("getNeutronPortFromDhcpIntf: neutronPort is a dhcp port", neutronPort );
+ return neutronPort;
+ }
+ return null;
}
@Override
neutronSubnetCache = (INeutronSubnetCRUD) impl;
}
}
-}
\ No newline at end of file
+}