Fix single node in visual topology 37/337/1
authorAndrew Kim <andrekim@cisco.com>
Mon, 13 May 2013 19:14:03 +0000 (12:14 -0700)
committerAndrew Kim <andrekim@cisco.com>
Mon, 13 May 2013 19:14:03 +0000 (12:14 -0700)
When staging a node from the cache, forgot to update the adjacencies correctly.

Signed-off-by: Andrew Kim <andrekim@cisco.com>
opendaylight/web/topology/src/main/java/org/opendaylight/controller/topology/web/Topology.java

index 0f4569fc19ded417398157a33cc529810e94ed14..b4695defdb4468d5e3a1324e723e6bab169513ae 100644 (file)
@@ -287,6 +287,8 @@ public class Topology implements IObjectReader, IConfigurationAware {
                                Map<String, String> data = (Map<String, String>) nodeEntry.get("data");
                        data.put("$desc", description);
                        nodeEntry.put("data", data);
                                Map<String, String> data = (Map<String, String>) nodeEntry.get("data");
                        data.put("$desc", description);
                        nodeEntry.put("data", data);
+                       // clear adjacencies since this is now a single node
+                       nodeEntry.put("adjacencies", new LinkedList<Map<String, Object>>());
                stagedNodes.put(node.id(), nodeEntry);
             } else {
                newNodes.put(node.id(), node.out());
                stagedNodes.put(node.id(), nodeEntry);
             } else {
                newNodes.put(node.id(), node.out());