- UUID localUUID = getLocatorUUID(transaction,
- (InstanceIdentifier<TerminationPoint>) tunnel.getLocalLocatorRef().getValue());
- UUID remoteUUID = getLocatorUUID(transaction,
- (InstanceIdentifier<TerminationPoint>) tunnel.getRemoteLocatorRef().getValue());
- if (localUUID != null && remoteUUID != null) {
- // local and remote must exist
- newTunnel.setLocal(localUUID);
- newTunnel.setRemote(remoteUUID);
- setBfdParams(newTunnel, tunnel);
- setBfdLocalConfigs(newTunnel, tunnel);
- setBfdRemoteConfigs(newTunnel, tunnel);
- if (!opTunnelOpt.isPresent()) {
- String tunnelUuid = "Tunnel_" + HwvtepSouthboundMapper.getRandomUUID();
- transaction.add(op.insert(newTunnel).withId(tunnelUuid));
- transaction.add(op.comment("Tunnel: Creating " + tunnelUuid));
- if (!switchExists) {
- //TODO: Figure out a way to handle this
- LOG.warn("Tunnel configuration requires pre-existing physicalSwitch");
- } else {
- // TODO: Can we reuse physicalSwitch instead?
- PhysicalSwitch phySwitch = transaction.getTypedRowWrapper(PhysicalSwitch.class);
- phySwitch.setTunnels(Collections.singleton(new UUID(tunnelUuid)));
- phySwitch.setName(physicalSwitchAugmentation.getHwvtepNodeName().getValue());
- transaction.add(op.mutate(phySwitch)
- .addMutation(phySwitch.getTunnels().getSchema(), Mutator.INSERT,
- phySwitch.getTunnels().getData())
- .where(phySwitch.getNameColumn().getSchema()
- .opEqual(phySwitch.getNameColumn().getData()))
- .build());
- transaction.add(op.comment("PhysicalSwitch: Mutating " + tunnelUuid));
- }
+ UUID localUUID = getLocatorUUID(transaction,
+ (InstanceIdentifier<TerminationPoint>) tunnel.getLocalLocatorRef().getValue());
+ UUID remoteUUID = getLocatorUUID(transaction,
+ (InstanceIdentifier<TerminationPoint>) tunnel.getRemoteLocatorRef().getValue());
+ if (localUUID != null && remoteUUID != null) {
+ // local and remote must exist
+ newTunnel.setLocal(localUUID);
+ newTunnel.setRemote(remoteUUID);
+ setBfdParams(newTunnel, tunnel);
+ setBfdLocalConfigs(newTunnel, tunnel);
+ setBfdRemoteConfigs(newTunnel, tunnel);
+ if (!opTunnelOpt.isPresent()) {
+ String tunnelUuid = "Tunnel_" + HwvtepSouthboundMapper.getRandomUUID();
+ transaction.add(op.insert(newTunnel).withId(tunnelUuid));
+ transaction.add(op.comment("Tunnel: Creating " + tunnelUuid));
+ if (!switchExists) {
+ //TODO: Figure out a way to handle this
+ LOG.warn("Tunnel configuration requires pre-existing physicalSwitch");