VOL-3368 Added object+error pair for funtion within error handling. This patch include modification requested for omci_cc send functions.
Change-Id: I2a8ed3123f4a2f3a33ae7a418bd9d1dbabbf103d
diff --git a/internal/pkg/onuadaptercore/omci_onu_upgrade.go b/internal/pkg/onuadaptercore/omci_onu_upgrade.go
index 0158977..58e78a4 100644
--- a/internal/pkg/onuadaptercore/omci_onu_upgrade.go
+++ b/internal/pkg/onuadaptercore/omci_onu_upgrade.go
@@ -536,10 +536,21 @@
logger.Infow(ctx, "OnuUpgradeFsm checking committed SW", log.Fields{
"device-id": oFsm.deviceID, "me-id": oFsm.inactiveImageMeID})
requestedAttributes := me.AttributeValueMap{"IsCommitted": 0, "IsActive": 0, "Version": ""}
- meInstance := oFsm.pOmciCC.sendGetMe(log.WithSpanFromContext(context.TODO(), ctx),
+ meInstance, err := oFsm.pOmciCC.sendGetMe(log.WithSpanFromContext(context.TODO(), ctx),
me.SoftwareImageClassID, oFsm.inactiveImageMeID, requestedAttributes, oFsm.pDeviceHandler.pOpenOnuAc.omciTimeout, false, oFsm.pAdaptFsm.commChan)
//accept also nil as (error) return value for writing to LastTx
// - this avoids misinterpretation of new received OMCI messages
+ if err != nil {
+ logger.Errorw(ctx, "OnuUpgradeFsm get Software Image ME result error",
+ log.Fields{"device-id": oFsm.deviceID, "Error": err})
+ pOnuUpgradeFsm := oFsm.pAdaptFsm
+ if pOnuUpgradeFsm != nil {
+ go func(a_pAFsm *AdapterFsm) {
+ _ = a_pAFsm.pFsm.Event(upgradeEvReset)
+ }(pOnuUpgradeFsm)
+ }
+ return
+ }
oFsm.pLastTxMeInstance = meInstance
}