Revert "VOL-4559: Delete the TP Instance and TP ID first once all the GEM"
This reverts commit 5467db8fa4fd1113cbdf93c11e7cf90284dd49f5.
Change-Id: I30b571a6ead40b86029a241132ec833df5ba7364
diff --git a/internal/pkg/resourcemanager/resourcemanager.go b/internal/pkg/resourcemanager/resourcemanager.go
index 05a5076..e9809f2 100755
--- a/internal/pkg/resourcemanager/resourcemanager.go
+++ b/internal/pkg/resourcemanager/resourcemanager.go
@@ -508,22 +508,18 @@
// for the given OLT device.
// The caller should ensure that this is a blocking call and this operation is serialized for
// the ONU so as not cause resource corruption since there are no mutexes used here.
-// Setting freeFromResourcePool to false will not clear it from the resource pool but only
-// clear it for the given pon/onu/uni
func (rsrcMgr *OpenOltResourceMgr) FreeAllocID(ctx context.Context, intfID uint32, onuID uint32,
- uniID uint32, allocID uint32, freeFromResourcePool bool) {
+ uniID uint32, allocID uint32) {
rsrcMgr.RemoveAllocIDForOnu(ctx, intfID, onuID, uniID, allocID)
- if freeFromResourcePool {
- allocIDs := make([]uint32, 0)
- allocIDs = append(allocIDs, allocID)
- if err := rsrcMgr.TechprofileRef.FreeResourceID(ctx, intfID, ponrmgr.ALLOC_ID, allocIDs); err != nil {
- logger.Errorw(ctx, "error-while-freeing-alloc-id", log.Fields{
- "intf-id": intfID,
- "onu-id": onuID,
- "err": err.Error(),
- })
- }
+ allocIDs := make([]uint32, 0)
+ allocIDs = append(allocIDs, allocID)
+ if err := rsrcMgr.TechprofileRef.FreeResourceID(ctx, intfID, ponrmgr.ALLOC_ID, allocIDs); err != nil {
+ logger.Errorw(ctx, "error-while-freeing-alloc-id", log.Fields{
+ "intf-id": intfID,
+ "onu-id": onuID,
+ "err": err.Error(),
+ })
}
}