[ONOS-5166] GroupModBuilder: no longer ignore weights
We provide an interface for assigning weights to buckets
in a group and thus we should not silently ignore it.
Properly set bucket weight to bucket.weight().
Change-Id: I7dce89e793140ee365a016f4bf26f0ccf206b8dd
diff --git a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java
index d473e66..464c2cc 100644
--- a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java
+++ b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java
@@ -152,7 +152,7 @@
OFBucket.Builder bucketBuilder = factory.buildBucket();
bucketBuilder.setActions(actions);
if (type == GroupDescription.Type.SELECT) {
- bucketBuilder.setWeight(1);
+ bucketBuilder.setWeight(bucket.weight());
}
if (type == GroupDescription.Type.FAILOVER && bucket.watchPort() != null) {
@@ -192,7 +192,7 @@
OFBucket.Builder bucketBuilder = factory.buildBucket();
bucketBuilder.setActions(actions);
if (type == GroupDescription.Type.SELECT) {
- bucketBuilder.setWeight(1);
+ bucketBuilder.setWeight(bucket.weight());
}
if (type == GroupDescription.Type.FAILOVER && bucket.watchPort() != null) {
bucketBuilder.setWatchPort(OFPort.of((int) bucket.watchPort().toLong()));