Committed by
Gerrit Code Review
fixing INVALID_GROUP error for FAILOVER type
Change-Id: Ieec82404d347dc812f49cf40c617e667381249d8
Showing
1 changed file
with
11 additions
and
2 deletions
... | @@ -154,8 +154,17 @@ public final class GroupModBuilder { | ... | @@ -154,8 +154,17 @@ public final class GroupModBuilder { |
154 | if (type == GroupDescription.Type.SELECT) { | 154 | if (type == GroupDescription.Type.SELECT) { |
155 | bucketBuilder.setWeight(1); | 155 | bucketBuilder.setWeight(1); |
156 | } | 156 | } |
157 | - bucketBuilder.setWatchGroup(OFGroup.ANY); | 157 | + |
158 | - bucketBuilder.setWatchPort(OFPort.ANY); | 158 | + if (type == GroupDescription.Type.FAILOVER && bucket.watchPort() != null) { |
159 | + bucketBuilder.setWatchPort(OFPort.of((int) bucket.watchPort().toLong())); | ||
160 | + } else { | ||
161 | + bucketBuilder.setWatchPort(OFPort.ANY); | ||
162 | + } | ||
163 | + if (type == GroupDescription.Type.FAILOVER && bucket.watchGroup() != null) { | ||
164 | + bucketBuilder.setWatchGroup(OFGroup.of(bucket.watchGroup().id())); | ||
165 | + } else { | ||
166 | + bucketBuilder.setWatchGroup(OFGroup.ANY); | ||
167 | + } | ||
159 | OFBucket ofBucket = bucketBuilder.build(); | 168 | OFBucket ofBucket = bucketBuilder.build(); |
160 | ofBuckets.add(ofBucket); | 169 | ofBuckets.add(ofBucket); |
161 | } | 170 | } | ... | ... |
-
Please register or login to post a comment