Fix duplicated services shown by bbsimctl commands
Change-Id: I56555f98448493e34dbcf58b98f4e1e4fc175d26
diff --git a/VERSION b/VERSION
index 587c5f0..3bf213d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.10.3
+1.10.4-dev
diff --git a/internal/bbsim/api/services_handler.go b/internal/bbsim/api/services_handler.go
index f016919..32b7794 100644
--- a/internal/bbsim/api/services_handler.go
+++ b/internal/bbsim/api/services_handler.go
@@ -18,9 +18,10 @@
import (
"context"
+ "strconv"
+
"github.com/opencord/bbsim/api/bbsim"
"github.com/opencord/bbsim/internal/bbsim/devices"
- "strconv"
)
func convertBBSimServiceToProtoService(s *devices.Service) *bbsim.Service {
@@ -67,11 +68,11 @@
for _, service := range s {
intVar, err := strconv.Atoi(req.UniID)
if req.UniID == "" && req.OnuSerialNumber == "" {
- services.Items = append(services.Items, s...)
+ services.Items = append(services.Items, service)
} else if err == nil && service.UniId == uint32(intVar) && service.OnuSn == req.OnuSerialNumber {
- services.Items = append(services.Items, s...)
+ services.Items = append(services.Items, service)
} else if req.UniID == "" && service.OnuSn == req.OnuSerialNumber {
- services.Items = append(services.Items, s...)
+ services.Items = append(services.Items, service)
}
}
}