VOL-3896: ONU fails to activate on Disable/Enable OLT
- Pass child device struct in Child_device_lost API call
Change-Id: I417e2a11e2da3a6415c63e3550988db15c9e0fcb
diff --git a/pkg/adapters/common/request_handler.go b/pkg/adapters/common/request_handler.go
index 459cac5..5a333c7 100644
--- a/pkg/adapters/common/request_handler.go
+++ b/pkg/adapters/common/request_handler.go
@@ -708,30 +708,17 @@
}
func (rhp *RequestHandlerProxy) Child_device_lost(ctx context.Context, args []*ic.Argument) error {
- if len(args) < 4 {
+ if len(args) < 2 {
logger.Warn(ctx, "invalid-number-of-args", log.Fields{"args": args})
return errors.New("invalid-number-of-args")
}
-
- pDeviceId := &ic.StrType{}
- pPortNo := &ic.IntType{}
- onuID := &ic.IntType{}
+ childDevice := &voltha.Device{}
fromTopic := &ic.StrType{}
for _, arg := range args {
switch arg.Key {
- case "pDeviceId":
- if err := ptypes.UnmarshalAny(arg.Value, pDeviceId); err != nil {
- logger.Warnw(ctx, "cannot-unmarshal-parent-deviceId", log.Fields{"error": err})
- return err
- }
- case "pPortNo":
- if err := ptypes.UnmarshalAny(arg.Value, pPortNo); err != nil {
- logger.Warnw(ctx, "cannot-unmarshal-port", log.Fields{"error": err})
- return err
- }
- case "onuID":
- if err := ptypes.UnmarshalAny(arg.Value, onuID); err != nil {
- logger.Warnw(ctx, "cannot-unmarshal-transaction-ID", log.Fields{"error": err})
+ case "childDevice":
+ if err := ptypes.UnmarshalAny(arg.Value, childDevice); err != nil {
+ logger.Warnw(ctx, "cannot-unmarshal-child-device", log.Fields{"error": err})
return err
}
case kafka.FromTopic:
@@ -742,9 +729,9 @@
}
}
//Update the core reference for that device
- rhp.coreProxy.UpdateCoreReference(pDeviceId.Val, fromTopic.Val)
+ rhp.coreProxy.UpdateCoreReference(childDevice.ParentId, fromTopic.Val)
//Invoke the Child_device_lost API on the adapter
- if err := rhp.adapter.Child_device_lost(ctx, pDeviceId.Val, uint32(pPortNo.Val), uint32(onuID.Val)); err != nil {
+ if err := rhp.adapter.Child_device_lost(ctx, childDevice); err != nil {
return status.Errorf(codes.NotFound, "%s", err.Error())
}
return nil
diff --git a/pkg/adapters/iAdapter.go b/pkg/adapters/iAdapter.go
index dfc3778..92a33e7 100644
--- a/pkg/adapters/iAdapter.go
+++ b/pkg/adapters/iAdapter.go
@@ -53,7 +53,7 @@
Revert_image_update(ctx context.Context, device *voltha.Device, request *voltha.ImageDownload) (*voltha.ImageDownload, error)
Enable_port(ctx context.Context, deviceId string, port *voltha.Port) error
Disable_port(ctx context.Context, deviceId string, port *voltha.Port) error
- Child_device_lost(ctx context.Context, parentDeviceId string, parentPortNo uint32, onuID uint32) error
+ Child_device_lost(ctx context.Context, childDevice *voltha.Device) error
Start_omci_test(ctx context.Context, device *voltha.Device, request *voltha.OmciTestRequest) (*voltha.TestResponse, error)
Get_ext_value(ctx context.Context, deviceId string, device *voltha.Device, valueflag voltha.ValueType_Type) (*voltha.ReturnValues, error)
Single_get_value_request(ctx context.Context, request extension.SingleGetValueRequest) (*extension.SingleGetValueResponse, error)