(vNet) fix : warning for virtual flow rules
Sometimes virtual flow rule provider complains about an null flow entry.
To remove this warning, handling statements are added.
Change-Id: I8f7802a35032a9ad3ba2c9f6a3394630bc63185b
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProvider.java b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProvider.java
index 2f203aa..bc519d4 100644
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProvider.java
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProvider.java
@@ -265,6 +265,11 @@
private FlowEntry virtualize(FlowEntry flowEntry) {
FlowRule vRule = virtualizeFlowRule(flowEntry);
+
+ if (vRule == null) {
+ return null;
+ }
+
FlowEntry vEntry = new DefaultFlowEntry(vRule, flowEntry.state(),
flowEntry.life(),
flowEntry.packets(),
@@ -610,6 +615,11 @@
if (frm.isVirtualIngressRule(event.subject())) {
NetworkId networkId = frm.getVirtualNetworkId(event.subject());
FlowEntry vEntry = getVirtualFlowEntry(event.subject());
+
+ if (vEntry == null) {
+ return;
+ }
+
frm.addOrUpdateFlowEntry(networkId, vEntry.deviceId(), vEntry);
VirtualFlowRuleProviderService providerService =
@@ -628,6 +638,10 @@
NetworkId networkId = frm.getVirtualNetworkId(event.subject());
FlowEntry vEntry = getVirtualFlowEntry(event.subject());
+ if (vEntry == null) {
+ return;
+ }
+
frm.removeFlowEntry(networkId, vEntry.deviceId(), vEntry);
frm.removeFlowRule(networkId, vEntry.deviceId(), vEntry);