[VOL-4031] openonuAdapterGo - TechProf delete fails after ONU reconcilement w/o OMCI-config

Change-Id: I250aafaebca110cbb5662cbc6a28fb2879678750
diff --git a/internal/pkg/onuadaptercore/omci_ani_config.go b/internal/pkg/onuadaptercore/omci_ani_config.go
index a38f823..296977d 100644
--- a/internal/pkg/onuadaptercore/omci_ani_config.go
+++ b/internal/pkg/onuadaptercore/omci_ani_config.go
@@ -60,6 +60,7 @@
 	aniEvTimeoutMids       = "aniEvTimeoutMids"
 	aniEvReset             = "aniEvReset"
 	aniEvRestart           = "aniEvRestart"
+	aniEvSkipOmciConfig    = "aniEvSkipOmciConfig"
 )
 const (
 	// states of config PON ANI port FSM
@@ -203,6 +204,7 @@
 				aniStResetTcont, aniStRemDot1PMapper, aniStRemAniBPCD, aniStRemoveDone}, Dst: aniStResetting},
 			// the only way to get to resource-cleared disabled state again is via "resseting"
 			{Name: aniEvRestart, Src: []string{aniStResetting}, Dst: aniStDisabled},
+			{Name: aniEvSkipOmciConfig, Src: []string{aniStStarting}, Dst: aniStConfigDone},
 		},
 
 		fsm.Callbacks{
@@ -443,6 +445,7 @@
 					"multicastGemID": loGemPortAttribs.multicastGemID,
 					"staticACL":      loGemPortAttribs.staticACL,
 					"dynamicACL":     loGemPortAttribs.dynamicACL,
+					"device-id":      oFsm.deviceID,
 				})
 
 			} else {
@@ -452,12 +455,18 @@
 					"downQueueID":    loGemPortAttribs.downQueueID,
 					"pbitString":     loGemPortAttribs.pbitString,
 					"prioQueueIndex": gemEntry.prioQueueIndex,
+					"device-id":      oFsm.deviceID,
 				})
 			}
 
 			oFsm.gemPortAttribsSlice = append(oFsm.gemPortAttribsSlice, loGemPortAttribs)
 		}
-		_ = aPAFsm.pFsm.Event(aniEvStartConfig)
+		if !oFsm.pDeviceHandler.isSkipOnuConfigReconciling() {
+			_ = aPAFsm.pFsm.Event(aniEvStartConfig)
+		} else {
+			logger.Debugw(ctx, "reconciling - skip omci-config of ANI side ", log.Fields{"device-id": oFsm.deviceID})
+			_ = aPAFsm.pFsm.Event(aniEvSkipOmciConfig)
+		}
 	}
 }
 
@@ -683,16 +692,19 @@
 func (oFsm *uniPonAniConfigFsm) enterAniConfigDone(ctx context.Context, e *fsm.Event) {
 	logger.Debugw(ctx, "uniPonAniConfigFsm ani config done", log.Fields{
 		"device-id": oFsm.deviceID, "uni-id": oFsm.pOnuUniPort.uniID, "techProfile-id": oFsm.techProfileID})
-	//use DeviceHandler event notification directly
-	oFsm.pDeviceHandler.deviceProcStatusUpdate(ctx, OnuDeviceEvent((uint8(oFsm.requestEvent) + oFsm.requestEventOffset)))
 	//store that the UNI related techProfile processing is done for the given Profile and Uni
 	oFsm.pUniTechProf.setConfigDone(oFsm.pOnuUniPort.uniID, oFsm.techProfileID, true)
-	//if techProfile processing is done it must be checked, if some prior/parallel flow configuration is pending
-	//  but only in case the techProfile was configured (not deleted)
-	if oFsm.requestEventOffset == 0 {
-		go oFsm.pDeviceHandler.verifyUniVlanConfigRequest(ctx, oFsm.pOnuUniPort, oFsm.techProfileID)
+	if !oFsm.pDeviceHandler.isSkipOnuConfigReconciling() {
+		//use DeviceHandler event notification directly
+		oFsm.pDeviceHandler.deviceProcStatusUpdate(ctx, OnuDeviceEvent((uint8(oFsm.requestEvent) + oFsm.requestEventOffset)))
+		//if techProfile processing is done it must be checked, if some prior/parallel flow configuration is pending
+		//  but only in case the techProfile was configured (not deleted)
+		if oFsm.requestEventOffset == 0 {
+			go oFsm.pDeviceHandler.verifyUniVlanConfigRequest(ctx, oFsm.pOnuUniPort, oFsm.techProfileID)
+		}
+	} else {
+		logger.Debugw(ctx, "reconciling - skip AniConfigDone processing", log.Fields{"device-id": oFsm.deviceID})
 	}
-
 	if oFsm.chanSet {
 		// indicate processing done to the caller
 		logger.Debugw(ctx, "uniPonAniConfigFsm processingDone on channel", log.Fields{
diff --git a/internal/pkg/onuadaptercore/onu_uni_tp.go b/internal/pkg/onuadaptercore/onu_uni_tp.go
index 8013cb0..eecac2a 100644
--- a/internal/pkg/onuadaptercore/onu_uni_tp.go
+++ b/internal/pkg/onuadaptercore/onu_uni_tp.go
@@ -249,17 +249,6 @@
 			aUniID, onuTP.deviceID)
 		return
 	}
-
-	if onuTP.baseDeviceHandler.isSkipOnuConfigReconciling() {
-		logger.Debugw(ctx, "reconciling - skip omci-config of ANI side ", log.Fields{"uni-id": aUniID, "device-id": onuTP.deviceID})
-		onuTP.mutexTPState.Lock()
-		defer onuTP.mutexTPState.Unlock()
-		if _, existTP := onuTP.mapUniTpIndication[uniTpKey]; existTP {
-			onuTP.mapUniTpIndication[uniTpKey].techProfileConfigDone = true
-		}
-		return
-	}
-
 	if onuTP.getProfileResetting(uniTpKey) {
 		logger.Debugw(ctx, "aborting TP configuration, reset requested in parallel", log.Fields{
 			"device-id": onuTP.deviceID, "uni-id": aUniID, "tp-id": uniTpKey.tpID})