[VOL-1385] : Changes to support ONU delete
Tested with,
1. ONU disable->delete
2. ONU delete
3. OLT delete
Change-Id: I8e6ff41a7ea8e94014700f274cb24fea73ac41f4
diff --git a/rw_core/core/device_manager.go b/rw_core/core/device_manager.go
index df94772..950819e 100755
--- a/rw_core/core/device_manager.go
+++ b/rw_core/core/device_manager.go
@@ -1509,3 +1509,12 @@
sendResponse(ctx, ch, res)
}
+
+// ChildDeviceLost calls parent adapter to delete child device and all its references
+func (dMgr *DeviceManager) ChildDeviceLost(ctx context.Context, cDevice *voltha.Device) error {
+ log.Debugw("ChildDeviceLost", log.Fields{"deviceid": cDevice.Id})
+ if parentAgent := dMgr.getDeviceAgent(ctx, cDevice.ParentId); parentAgent != nil {
+ return parentAgent.ChildDeviceLost(ctx, cDevice)
+ }
+ return status.Errorf(codes.NotFound, "%s", cDevice.Id)
+}