Bug 1396 : Change from deprecated DataBrokerService to DataBroker 22/10022/1
authorFlavio Fernandes <ffernand@redhat.com>
Mon, 18 Aug 2014 13:09:41 +0000 (09:09 -0400)
committerFlavio Fernandes <ffernand@redhat.com>
Mon, 18 Aug 2014 13:09:41 +0000 (09:09 -0400)
As a follow up from my conversation with edwarnicke, it turns out that
OVSDB should be in charge of creating whatever missing parents it needs
for the flow creation configuration. An issue still remains in regards
to who/when removes the node portion of the tree once all flows are
removed. That will be tracked by another bug, and bug 1396 will be
linked with it.

For more details, see: https://gist.github.com/864043e0a96c4e704497

Change-Id: I0f28a369c55e7af3d84fc7ddbef93f0efe3f5b30
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/OF13Provider.java

index 97f57acf919c56f27faaa250427386896c6cf59a..4da8f928bd348d25efad7ac5033262131ae54c7e 100644 (file)
@@ -2582,21 +2582,6 @@ public class OF13Provider implements NetworkingProvider {
         }
 
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
-
-        // Sanity check: do not create parent's tree deeper than we should
-        InstanceIdentifier<?> requiredPath = InstanceIdentifier.builder(Nodes.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory
-                .rev130819.nodes.Node.class, nodeBuilder.getKey()).build();
-        try {
-            if (!modification.read(LogicalDatastoreType.CONFIGURATION, requiredPath).get().isPresent()) {
-                logger.error("Unable to get configuration resource to store group "+groupBuilder.getGroupName()
-                        +" ("+requiredPath.toString()+")");
-                return;
-            }
-        } catch (InterruptedException|ExecutionException e) {
-            logger.error(e.getMessage(), e);
-            return;
-        }
-
         InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory
                 .rev130819.nodes.Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class).child(Group.class,
                 new GroupKey(groupBuilder.getGroupId())).build();
@@ -2683,21 +2668,6 @@ public class OF13Provider implements NetworkingProvider {
         }
 
         ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
-
-        // Sanity check: do not create parent's tree deeper than we should
-        InstanceIdentifier<?> requiredPath = InstanceIdentifier.builder(Nodes.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory
-                .rev130819.nodes.Node.class, nodeBuilder.getKey()).build();
-        try {
-            if (!modification.read(LogicalDatastoreType.CONFIGURATION, requiredPath).get().isPresent()) {
-                logger.error("Unable to get configuration resource to store flow "+flowBuilder.getFlowName()
-                        +" ("+requiredPath.toString()+")");
-                return;
-            }
-        } catch (InterruptedException|ExecutionException e) {
-            logger.error(e.getMessage(), e);
-            return;
-        }
-
         InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory
                 .rev130819.nodes.Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class).child(Table.class,
                 new TableKey(flowBuilder.getTableId())).child(Flow.class, flowBuilder.getKey()).build();