Edges are left in TopologyManager database when nodes disconnect 19/5919/1
authorMaurice Qureshi <maquresh@cisco.com>
Sat, 5 Apr 2014 03:17:22 +0000 (20:17 -0700)
committerMaurice Qureshi <maquresh@cisco.com>
Sat, 5 Apr 2014 03:17:22 +0000 (20:17 -0700)
When nodes are disconnected from ODL Controller, some edges are left
in TopologyManager's database. As a result GUI (and possibly REST APIs0
still shows some switches to be connected even when there are no
switches connected to the controller.

Change-Id: Ia4a5ae0160b07ba0207bf763dbc234e34dcf5816
Signed-off-by: Maurice Qureshi <maquresh@cisco.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java

index 548bfb1..fc668b3 100644 (file)
@@ -945,7 +945,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa
         if (!src.getType().equals(NodeConnector.NodeConnectorIDType.PRODUCTION)) {
             if (type == UpdateType.ADDED) {
                 edgeMap.put(dst, edge);
-            } else {
+            } else if (type == UpdateType.REMOVED) {
                 edgeMap.remove(dst);
             }
         } else {
@@ -954,7 +954,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa
              */
             if (type == UpdateType.ADDED) {
                 prodMap.put(dst, edge);
-            } else {
+            } else if (type == UpdateType.REMOVED) {
                 prodMap.remove(dst);
             }
         }