Map<InstanceIdentifier<?>, RendererName> rendererByNode) {
Optional<InstanceIdentifier<?>> potentialAbsNodeLoc = EndpointLocationUtils.resolveAbsoluteNodeLocation(epLoc);
if (potentialAbsNodeLoc.isPresent()) {
- return Optional.of(rendererByNode.get(potentialAbsNodeLoc.get()));
+ if (rendererByNode.get(potentialAbsNodeLoc.get()) != null) {
+ return Optional.of(rendererByNode.get(potentialAbsNodeLoc.get()));
+ } else {
+ return Optional.absent();
+ }
}
Optional<List<InstanceIdentifier<?>>> potentianRelativeLocation =
EndpointLocationUtils.resolveRelativeExternalNodeMountPointLocation(epLoc);
getInterfacesForEndpoint(policyCtx, KeyFactory.addressEndpointKey(endpointKey));
interfacesForEndpoint.keySet().forEach(nodeId -> {
ImmutableSet<InterfaceKey> intfcsOnNode = interfacesForEndpoint.get(nodeId);
- intfcsOnNode.forEach(intf -> {
- if (aceTable.get(nodeId, intf) != null) {
+ intfcsOnNode.forEach(intfKey -> {
+ Optional<String> intfName =
+ VppPathMapper.interfacePathToInterfaceName(intfKey.getName());
+ Preconditions.checkArgument(intfName.isPresent(), "Failed to resolve interface name from " + intfKey);
+ if (aceTable.get(nodeId, intfKey) != null) {
List<Ace> aces = Stream
- .concat(aceTable.get(nodeId, intf).stream(),
+ .concat(aceTable.get(nodeId, intfKey).stream(),
aceBuilders.stream().map(aceBuilder -> aceBuilder.build()))
.collect(Collectors.toList());
- aceTable.put(nodeId, new AclKey(intf.getName() + aceDirection, VppAcl.class), aces);
+ aceTable.put(nodeId, new AclKey(intfName.get() + aceDirection, VppAcl.class), aces);
} else {
- aceTable.put(nodeId, new AclKey(intf.getName() + aceDirection, VppAcl.class),
+ aceTable.put(nodeId, new AclKey(intfName.get() + aceDirection, VppAcl.class),
aceBuilders.stream()
.map(aceBuilder -> aceBuilder.build())
.collect(Collectors.toList()));
@Override
public Void call() throws Exception {
- LOG.debug("Updating node {}", nodeId);
InstanceIdentifier<Node> vppIid = VppIidFactory.getNetconfNodeIid(nodeId);
Optional<DataBroker> dataBroker =
mountDataProvider.resolveDataBrokerForMountPoint(vppIid);
if (entries.isEmpty()) {
return;
}
- LOG.info("Updating ACL: Action={}, Node={}, ACL={}", write, nodeId.getValue(),
+ LOG.debug("Updating ACL: Action={}, Node={}, ACL={}", write, nodeId.getValue(),
aclKey.getAclName());
boolean result = (write) ? GbpNetconfTransaction.netconfSyncedWrite(vppIid, entries,
GbpNetconfTransaction.RETRY_COUNT) : GbpNetconfTransaction.netconfSyncedDelete(