[VOL-4771] Error deleting device via voltctl when OLT is unreachable
Change-Id: I4cae0625a78a61b470db47b0339e078108d108c9
diff --git a/internal/pkg/resourcemanager/resourcemanager.go b/internal/pkg/resourcemanager/resourcemanager.go
index 7e4044b..26a73ad 100755
--- a/internal/pkg/resourcemanager/resourcemanager.go
+++ b/internal/pkg/resourcemanager/resourcemanager.go
@@ -1404,14 +1404,15 @@
}
//DeleteMcastQueueForIntf deletes multicast queue info for the current pon interface from kvstore
-func (rsrcMgr *OpenOltResourceMgr) DeleteMcastQueueForIntf(ctx context.Context) {
+func (rsrcMgr *OpenOltResourceMgr) DeleteMcastQueueForIntf(ctx context.Context) error {
path := McastQueuesForIntf
if err := rsrcMgr.KVStore.Delete(ctx, path); err != nil {
logger.Errorw(ctx, "Failed to delete multicast queue info from kvstore", log.Fields{"err": err, "interfaceId": rsrcMgr.PonIntfID})
- return
+ return err
}
logger.Debugw(ctx, "deleted multicast queue info from KV store successfully", log.Fields{"interfaceId": rsrcMgr.PonIntfID})
+ return nil
}
//AddFlowGroupToKVStore adds flow group into KV store
diff --git a/internal/pkg/resourcemanager/resourcemanager_test.go b/internal/pkg/resourcemanager/resourcemanager_test.go
index 84b00e8..b1ba8ef 100644
--- a/internal/pkg/resourcemanager/resourcemanager_test.go
+++ b/internal/pkg/resourcemanager/resourcemanager_test.go
@@ -1016,7 +1016,7 @@
RsrcMgr := testResMgrObject(tt.fields)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
- RsrcMgr.DeleteMcastQueueForIntf(ctx)
+ _ = RsrcMgr.DeleteMcastQueueForIntf(ctx)
})
}
}