- try {
- for (String route : routeList) {
- // assuming extra route is strictly in the format "nexthop destination" > "10.1.1.10 40.0.1.0/24"
- String[] parts = route.split(" ");
- if (parts.length == 2) {
- String nextHop = parts[0];
- String destination = parts[1];
-
- String tapPortName = NeutronvpnUtils.getNeutronPortNamefromPortFixedIp(broker, nextHop);
- logger.trace("Removing extra route with nexthop {}, destination {}, ifName {}", nextHop,
- destination, tapPortName);
- InstanceIdentifier<Adjacency> adjacencyIdentifier = InstanceIdentifier.builder(VpnInterfaces.class).
- child(VpnInterface.class, new VpnInterfaceKey(tapPortName)).augmentation(Adjacencies.class)
- .child(Adjacency.class, new AdjacencyKey(destination)).build();
+ for (String route : routeList) {
+ // assuming extra route is strictly in the format "nexthop destination" > "10.1.1.10 40.0.1.0/24"
+ String[] parts = route.split(" ");
+ if (parts.length == 2) {
+ boolean isLockAcquired = false;
+ String nextHop = parts[0];
+ String destination = parts[1];
+
+ String tapPortName = NeutronvpnUtils.getNeutronPortNamefromPortFixedIp(broker, nextHop);
+ logger.trace("Removing extra route with nexthop {}, destination {}, ifName {}", nextHop,
+ destination, tapPortName);
+ InstanceIdentifier<Adjacency> adjacencyIdentifier = InstanceIdentifier.builder(VpnInterfaces.class).
+ child(VpnInterface.class, new VpnInterfaceKey(tapPortName)).augmentation(Adjacencies.class)
+ .child(Adjacency.class, new AdjacencyKey(destination)).build();
+ try {
+ isLockAcquired = NeutronvpnUtils.lock(lockManager, tapPortName);