public void removePortFromCleanupCache(NeutronPort port) { if(port != null) { this.portCleanupCache.remove(port.getPortUUID()); } }
private void storePortInCleanupCache(NeutronPort port) { this.portCleanupCache.put(port.getPortUUID(),port); }
private void initPortCleanUpCache() { if (this.neutronPortCache != null) { for (NeutronPort neutronPort : neutronPortCache.getAllPorts()) { portCleanupCache.put(neutronPort.getPortUUID(), neutronPort); } } } @Override
private OvsdbTerminationPointAugmentation findPortOnNode(Node node, NeutronPort neutronPort){ try { List<OvsdbTerminationPointAugmentation> ports = southbound.readTerminationPointAugmentations(node); for (OvsdbTerminationPointAugmentation port : ports) { String neutronPortId = southbound.getInterfaceExternalIdsValue(port, Constants.EXTERNAL_ID_INTERFACE_ID); if (neutronPortId != null && neutronPortId.equalsIgnoreCase(neutronPort.getPortUUID())) { return port; } } } catch (Exception e) { LOG.error("Exception while reading ports", e); } return null; }
private void cleanupFloatingIPRules(final NeutronPort neutronPort) { List<NeutronFloatingIP> neutronFloatingIps = neutronFloatingIpCache.getAllFloatingIPs(); if (neutronFloatingIps != null && !neutronFloatingIps.isEmpty()) { for (NeutronFloatingIP neutronFloatingIP : neutronFloatingIps) { // Neutron floating Ip's port uuid cannot be null (Bug#5894) if (neutronFloatingIP.getPortUUID() != null && (neutronFloatingIP.getPortUUID().equals(neutronPort.getPortUUID()))) { handleNeutronFloatingIPEvent(neutronFloatingIP, DELETE); } } } }
private void updateFloatingIPRules(final NeutronPort neutronPort) { List<NeutronFloatingIP> neutronFloatingIps = neutronFloatingIpCache.getAllFloatingIPs(); if (neutronFloatingIps != null) { for (NeutronFloatingIP neutronFloatingIP : neutronFloatingIps) { if (neutronFloatingIP.getPortUUID() != null && neutronFloatingIP.getPortUUID().equals( neutronPort.getPortUUID())) { handleNeutronFloatingIPEvent(neutronFloatingIP, UPDATE); } } } }
private Pair<Long, Uuid> getDpIdOfNeutronPort(String neutronTenantPortUuid) { if(neutronPortToDpIdCache.get(neutronTenantPortUuid) == null) { List<Node> bridges = this.southbound.readOvsdbTopologyBridgeNodes(); LOG.debug("getDpIdOfNeutronPort : {} bridges present in ovsdb topology",bridges.size()); for(Node bridge : bridges) { List<OvsdbTerminationPointAugmentation> interfaces = southbound.extractTerminationPointAugmentations(bridge); if(interfaces != null && !interfaces.isEmpty()) { LOG.debug("getDpIdOfNeutronPort : {} termination point present on bridge {}", interfaces.size(), bridge.getNodeId()); for (OvsdbTerminationPointAugmentation intf : interfaces) { NeutronPort neutronPort = tenantNetworkManager.getTenantPort(intf); if(neutronPort != null && neutronPort.getID().equals(neutronTenantPortUuid)) { Long dpId = getDpidForIntegrationBridge(bridge); Uuid interfaceUuid = intf.getInterfaceUuid(); LOG.debug("getDpIdOfNeutronPort : Found bridge {} and interface {} for the tenant neutron" + " port {}",dpId,interfaceUuid,neutronTenantPortUuid); handleInterfaceEventAdd(neutronPort.getPortUUID(), dpId, interfaceUuid); break; } } } } } return neutronPortToDpIdCache.get(neutronTenantPortUuid); }
if((null == fixedIps || fixedIps.isEmpty()) && actionToPerform == Action.DELETE && isDhcpPort){ fixedIps = dhcpPortIpCache.get(neutronPort.getPortUUID()); if(fixedIps == null) { return; dhcpPortIpCache.put(neutronPort.getPortUUID(), fixedIps); } else if (isDhcpPort && action == Action.DELETE) { dhcpPortIpCache.remove(neutronPort.getPortUUID());
for (String field: fields) { if ("id".equals(field)) { ans.setPortUUID(this.getPortUUID());
final String neutronPortUuid = neutronPort.getPortUUID();
portBuilder.setTenantId(toUuid(neutronPort.getTenantID())); if (neutronPort.getPortUUID() != null) { portBuilder.setUuid(toUuid(neutronPort.getPortUUID())); } else { LOG.warn("Attempting to write neutron port without UUID");
for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) { NeutronRouter_Interface neutronRouterInterface = new NeutronRouter_Interface(neutronIP.getSubnetUUID(), neutronPort.getPortUUID());