commit | d4fbba71a6ba6b82e3aecf2ab19d915eef6ca288 | [log] [tgz] |
---|---|---|
author | senthil <s.senthil@samsung.com> | Tue Mar 22 11:31:34 2022 +0530 |
committer | Thomas Vachuska <tom@opennetworking.org> | Fri Apr 08 15:54:06 2022 +0000 |
tree | ecba5564dbee7710fa35226c074711ecbfbc4d47 | |
parent | 75baa0b33f468234b011b7a7c32cf7b08b989313 [diff] |
Remove links when device status changed. Discovered links should be removed immediately When device status become unavailable. Change-Id: I6cd771716f5c232294a49484b700a1aa122f7350
diff --git a/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java b/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java index 7f29cc5..857c2d8 100644 --- a/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java +++ b/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java
@@ -336,6 +336,11 @@ case DEVICE_REMOVED: evaluateLinks(device.id(), Sets.newHashSet()); break; + case DEVICE_AVAILABILITY_CHANGED: + if (!deviceService.isAvailable(device.id())) { + evaluateLinks(device.id(), Sets.newHashSet()); + } + break; default: log.debug("No implemented action for other DeviceEvents for the device {}", device.id()); break;