- transaction.put(type, path, tpb.build());
- transaction.submit();
- } else {
- transaction.cancel();
- }
- } catch (InterruptedException | ExecutionException e) {
- LOG.error("Error initializing ovsdb topology", e);
- }
- }
-
- private void initializeTopology(LogicalDatastoreType type) {
- ReadWriteTransaction transaction = db.newReadWriteTransaction();
- InstanceIdentifier<NetworkTopology> path = InstanceIdentifier.create(NetworkTopology.class);
- CheckedFuture<Optional<NetworkTopology>, ReadFailedException> topology = transaction.read(type,path);
- try {
- if (!topology.get().isPresent()) {
- NetworkTopologyBuilder ntb = new NetworkTopologyBuilder();
- transaction.put(type,path,ntb.build());
+ transaction.put(type, path, tpb.build(), true);