VOL-3896: ONU fails to activate again if ONU is deleted after OLT disable
- When OLT is disabled the local cache of child devices are cleared in openolt adapter.
  If ONU delete were triggered post OLT disable, the openolt adapter does not
  have relevant information (esp. ONU serial number) in Child_device_lost API
  call to pass down to OLT agent to delete the ONU context. The local cache too is void
  of this information as it was cleared on OLT disable.
  A possible fix is to pass down the entire ONU Device struct in Child_device_lost
  API which contains all the relevant information to clear the ONU context on the OLT.

Change-Id: I76e28a0a46c1c82b25c859160466abfff693ed09
diff --git a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/adapters/common/request_handler.go b/vendor/github.com/opencord/voltha-lib-go/v4/pkg/adapters/common/request_handler.go
index 459cac5..5a333c7 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/adapters/common/request_handler.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v4/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/vendor/github.com/opencord/voltha-lib-go/v4/pkg/adapters/iAdapter.go b/vendor/github.com/opencord/voltha-lib-go/v4/pkg/adapters/iAdapter.go
index dfc3778..92a33e7 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/adapters/iAdapter.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v4/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)
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 1c5edf9..7e4c2b9 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -52,7 +52,7 @@
 # github.com/jcmturner/gofork v1.0.0
 github.com/jcmturner/gofork/encoding/asn1
 github.com/jcmturner/gofork/x/crypto/pbkdf2
-# github.com/opencord/voltha-lib-go/v4 v4.0.12
+# github.com/opencord/voltha-lib-go/v4 v4.1.0
 github.com/opencord/voltha-lib-go/v4/pkg/adapters
 github.com/opencord/voltha-lib-go/v4/pkg/adapters/adapterif
 github.com/opencord/voltha-lib-go/v4/pkg/adapters/common