Skip to content
Snippets Groups Projects
Commit 11bfeb7a authored by Kanzhe Jiang's avatar Kanzhe Jiang Committed by abat
Browse files

Select only non-internal AP when merging cluster

parent 0576d1aa
No related branches found
No related tags found
No related merge requests found
...@@ -1350,7 +1350,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener, ...@@ -1350,7 +1350,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
// Get only the latest DAPs into a map // Get only the latest DAPs into a map
for (DeviceAttachmentPoint dap : d.getAttachmentPoints()) { for (DeviceAttachmentPoint dap : d.getAttachmentPoints()) {
if (DeviceAttachmentPoint.isNotNull(dap)) { if (DeviceAttachmentPoint.isNotNull(dap) &&
!topology.isInternal(dap.getSwitchPort())) {
long clusterId = long clusterId =
dap.getSwitchPort().getSw().getSwitchClusterId(); dap.getSwitchPort().getSw().getSwitchClusterId();
if (map.containsKey(clusterId)) { if (map.containsKey(clusterId)) {
...@@ -1358,8 +1359,7 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener, ...@@ -1358,8 +1359,7 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
// point to "old" list. // point to "old" list.
// They are removed after deleting from storage. // They are removed after deleting from storage.
DeviceAttachmentPoint value = map.get(clusterId); DeviceAttachmentPoint value = map.get(clusterId);
if (dap.getLastSeen().after(value.getLastSeen()) && if (dap.getLastSeen().after(value.getLastSeen())) {
!topology.isInternal(dap.getSwitchPort())) {
map.put(clusterId, dap); map.put(clusterId, dap);
d.addOldAttachmentPoint(value); // on copy of device d.addOldAttachmentPoint(value); // on copy of device
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment