Merge "BUG-5489 Group Delete not working with ovs2.5"
authorAnil Vishnoi <vishnoianil@gmail.com>
Mon, 21 Mar 2016 22:13:19 +0000 (22:13 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 21 Mar 2016 22:13:19 +0000 (22:13 +0000)
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/GroupConvertor.java

index 5b8fc318b7f258881a882c7ebf4c71115513241c..2a73c8bbaa0b98e9d8bd890adf02f74404c0e5d5 100644 (file)
@@ -91,12 +91,15 @@ public final class GroupConvertor {
 
         groupModInputBuilder.setGroupId(new GroupId(source.getGroupId().getValue()));
         // Only if the bucket is configured for the group then add it
-        if ((source.getBuckets() != null) && (source.getBuckets().getBucket().size() != 0)) {
+        // During group deletion donot push the buckets
+        if(groupModInputBuilder.getCommand() != GroupModCommand.OFPGCDELETE) {
+            if ((source.getBuckets() != null) && (source.getBuckets().getBucket().size() != 0)) {
 
-            Collections.sort(source.getBuckets().getBucket(), comparator);
+                Collections.sort(source.getBuckets().getBucket(), comparator);
 
-            bucketLists = salToOFBucketList(source.getBuckets(), version, source.getGroupType().getIntValue(),datapathid);
-            groupModInputBuilder.setBucketsList(bucketLists);
+                bucketLists = salToOFBucketList(source.getBuckets(), version, source.getGroupType().getIntValue(), datapathid);
+                groupModInputBuilder.setBucketsList(bucketLists);
+            }
         }
         groupModInputBuilder.setVersion(version);
         return groupModInputBuilder;