BUG 8340: Handle case when aceList is also empty 84/56284/2
authorJamo Luhrsen <jluhrsen@redhat.com>
Fri, 28 Apr 2017 18:53:19 +0000 (11:53 -0700)
committerSam Hague <shague@redhat.com>
Tue, 2 May 2017 01:18:16 +0000 (01:18 +0000)
Change-Id: If76c63ec6c5dd00811f593ac8d6058341b8e1cf1
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
vpnservice/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/listeners/AclEventListener.java
vpnservice/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtils.java

index 2352149b32b0363fd75187fc064f056ba8c5c3f9..b329663d19d17229c9adb0798f63bb18d5ba3751 100644 (file)
@@ -81,8 +81,9 @@ public class AclEventListener extends AsyncDataTreeChangeListenerBase<Acl, AclEv
 
     @Override
     protected void update(InstanceIdentifier<Acl> key, Acl aclBefore, Acl aclAfter) {
-        if (!AclServiceUtils.isOfAclInterest(aclAfter)) {
-            LOG.trace("{} does not have SecurityRuleAttr augmentation", aclAfter.getAclName());
+        if (!AclServiceUtils.isOfAclInterest(aclAfter) || !AclServiceUtils.isOfAclInterest(aclBefore)) {
+            LOG.trace("before {} and/or after {} does not have SecurityRuleAttr augmentation",
+                    aclBefore.getAclName(), aclAfter.getAclName());
             return;
         }
 
index 4c36ef4a9a98aaf3c7c9c7afc6f2a9caa5b56132..cc5ea7213423af481691f3f1af3f908f2897f59a 100644 (file)
@@ -1057,7 +1057,7 @@ public final class AclServiceUtils {
 
     public static boolean isOfAclInterest(Acl acl) {
         List<Ace> aceList = acl.getAccessListEntries().getAce();
-        if (aceList != null) {
+        if ((aceList != null) && !aceList.isEmpty()) {
             return (aceList.get(0).getAugmentation(SecurityRuleAttr.class) != null);
         }
         return false;