Adding missing device-id to several warning and error logs
Change-Id: Ia1e084d079b5c7f8369596077a062ebcef03a090
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 920802a..a442ab8 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -406,7 +406,8 @@
uniID := uint8(techProfMsg.UniId)
tpID, err := cmn.GetTpIDFromTpPath(techProfMsg.TpInstancePath)
if err != nil {
- logger.Errorw(ctx, "error-parsing-tpid-from-tppath", log.Fields{"err": err, "tp-path": techProfMsg.TpInstancePath})
+ logger.Errorw(ctx, "error-parsing-tpid-from-tppath",
+ log.Fields{"device-id": dh.DeviceID, "err": err, "tp-path": techProfMsg.TpInstancePath})
return err
}
logger.Debugw(ctx, "unmarshal-techprof-msg-body", log.Fields{"device-id": dh.DeviceID,
@@ -4354,7 +4355,8 @@
logger.Debugw(subCtx, "send-omci-request", log.Fields{"request": request, "parent-endpoint": parentEndpoint})
_, err = pgClient.ProxyOmciRequests(subCtx, request)
if err != nil {
- logger.Errorw(ctx, "omci-failure", log.Fields{"request": request, "error": err, "request-parent": request.ParentDeviceId, "request-child": request.ChildDeviceId, "request-proxy": request.ProxyAddress})
+ logger.Errorw(ctx, "omci-failure", log.Fields{"device-id": dh.device.Id, "request": request, "error": err,
+ "request-parent": request.ParentDeviceId, "request-child": request.ChildDeviceId, "request-proxy": request.ProxyAddress})
}
return err
}
diff --git a/internal/pkg/core/openonu.go b/internal/pkg/core/openonu.go
index 890b92d..60d2f81 100755
--- a/internal/pkg/core/openonu.go
+++ b/internal/pkg/core/openonu.go
@@ -628,12 +628,12 @@
vendorID = onuVolthaDevice.VendorId
imageIdentifier = vendorID + imageIdentifier //head on vendor ID of the ONU
vendorIDSet = true
- logger.Debugw(ctx, "status request for image", log.Fields{"image-id": imageIdentifier})
+ logger.Debugw(ctx, "status request for image", log.Fields{"device-id": loDeviceID, "image-id": imageIdentifier})
} else {
//for all following devices verify the matching vendorID
if onuVolthaDevice.VendorId != vendorID {
logger.Warnw(ctx, "onu vendor id does not match image vendor id, device ignored",
- log.Fields{"onu-vendor-id": onuVolthaDevice.VendorId, "image-vendor-id": vendorID})
+ log.Fields{"device-id": loDeviceID, "onu-vendor-id": onuVolthaDevice.VendorId, "image-vendor-id": vendorID})
} else {
vendorIDSet = true
}
@@ -701,12 +701,12 @@
vendorID = onuVolthaDevice.VendorId
vendorIDSet = true
imageIdentifier = vendorID + imageIdentifier //head on vendor ID of the ONU
- logger.Debugw(ctx, "abort request for file", log.Fields{"image-id": imageIdentifier})
+ logger.Debugw(ctx, "abort request for file", log.Fields{"device-id": loDeviceID, "image-id": imageIdentifier})
} else {
//for all following devices verify the matching vendorID
if onuVolthaDevice.VendorId != vendorID {
logger.Warnw(ctx, "onu vendor id does not match image vendor id, device ignored",
- log.Fields{"onu-vendor-id": onuVolthaDevice.VendorId, "image-vendor-id": vendorID})
+ log.Fields{"device-id": loDeviceID, "onu-vendor-id": onuVolthaDevice.VendorId, "image-vendor-id": vendorID})
pDeviceImageState.DeviceId = loDeviceID
pDeviceImageState.ImageState.Version = (*in).Version
pDeviceImageState.ImageState.DownloadState = voltha.ImageState_DOWNLOAD_UNKNOWN