Committed by
Gerrit Code Review
BugFix for ONOS-4942.
- Was excluding EdgePort when trying to remove EdgePort... Change-Id: I79da723da5b045e322ec9b9cdb5457a17f1aceb4
Showing
1 changed file
with
5 additions
and
3 deletions
| ... | @@ -51,7 +51,6 @@ import java.nio.ByteBuffer; | ... | @@ -51,7 +51,6 @@ import java.nio.ByteBuffer; |
| 51 | import java.util.Map; | 51 | import java.util.Map; |
| 52 | import java.util.Optional; | 52 | import java.util.Optional; |
| 53 | import java.util.Set; | 53 | import java.util.Set; |
| 54 | - | ||
| 55 | import static org.onosproject.net.device.DeviceEvent.Type.*; | 54 | import static org.onosproject.net.device.DeviceEvent.Type.*; |
| 56 | import static org.onosproject.net.edge.EdgePortEvent.Type.EDGE_PORT_ADDED; | 55 | import static org.onosproject.net.edge.EdgePortEvent.Type.EDGE_PORT_ADDED; |
| 57 | import static org.onosproject.net.edge.EdgePortEvent.Type.EDGE_PORT_REMOVED; | 56 | import static org.onosproject.net.edge.EdgePortEvent.Type.EDGE_PORT_REMOVED; |
| ... | @@ -153,6 +152,8 @@ public class EdgeManager | ... | @@ -153,6 +152,8 @@ public class EdgeManager |
| 153 | 152 | ||
| 154 | @Override | 153 | @Override |
| 155 | public void event(TopologyEvent event) { | 154 | public void event(TopologyEvent event) { |
| 155 | + log.trace("Processing TopologyEvent {} caused by {}", | ||
| 156 | + event.subject(), event.reasons()); | ||
| 156 | topology = event.subject(); | 157 | topology = event.subject(); |
| 157 | event.reasons().forEach(reason -> { | 158 | event.reasons().forEach(reason -> { |
| 158 | if (reason instanceof DeviceEvent) { | 159 | if (reason instanceof DeviceEvent) { |
| ... | @@ -239,7 +240,8 @@ public class EdgeManager | ... | @@ -239,7 +240,8 @@ public class EdgeManager |
| 239 | 240 | ||
| 240 | // Removes the specified connection point from the edge points. | 241 | // Removes the specified connection point from the edge points. |
| 241 | private void removeEdgePort(ConnectPoint point) { | 242 | private void removeEdgePort(ConnectPoint point) { |
| 242 | - if (isEdgePort(point)) { | 243 | + // trying to remove edge ports, so we shouldn't check if it's EdgePoint |
| 244 | + if (!point.port().isLogical()) { | ||
| 243 | Set<ConnectPoint> set = connectionPoints.get(point.deviceId()); | 245 | Set<ConnectPoint> set = connectionPoints.get(point.deviceId()); |
| 244 | if (set == null) { | 246 | if (set == null) { |
| 245 | return; | 247 | return; |
| ... | @@ -250,7 +252,7 @@ public class EdgeManager | ... | @@ -250,7 +252,7 @@ public class EdgeManager |
| 250 | if (set.isEmpty()) { | 252 | if (set.isEmpty()) { |
| 251 | connectionPoints.computeIfPresent(point.deviceId(), (k, v) -> { | 253 | connectionPoints.computeIfPresent(point.deviceId(), (k, v) -> { |
| 252 | if (v.isEmpty()) { | 254 | if (v.isEmpty()) { |
| 253 | - return v; | 255 | + return null; |
| 254 | } else { | 256 | } else { |
| 255 | return v; | 257 | return v; |
| 256 | } | 258 | } | ... | ... |
-
Please register or login to post a comment