VOL-5227 error code retrun
Change-Id: I4f070e16b637b5a1ba2b0b1b5504e0b083306436
diff --git a/VERSION b/VERSION
index c966188..f12d1f2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.4.7
+4.4.8
diff --git a/internal/pkg/core/openolt.go b/internal/pkg/core/openolt.go
index 77d607c..78ee3e0 100644
--- a/internal/pkg/core/openolt.go
+++ b/internal/pkg/core/openolt.go
@@ -20,9 +20,6 @@
import (
"context"
"fmt"
- "sync"
- "time"
-
"github.com/golang/protobuf/ptypes/empty"
conf "github.com/opencord/voltha-lib-go/v7/pkg/config"
"github.com/opencord/voltha-lib-go/v7/pkg/events/eventif"
@@ -38,6 +35,10 @@
ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
"github.com/opencord/voltha-protos/v5/go/omci"
"github.com/opencord/voltha-protos/v5/go/voltha"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
+ "sync"
+ "time"
)
// OpenOLT structure holds the OLT information
@@ -196,6 +197,9 @@
handler.transitionMap = NewTransitionMap(handler)
handler.transitionMap.Handle(log.WithSpanFromContext(context.Background(), ctx), DeviceInit)
+ } else {
+ logger.Warnf(ctx, "device-already-reconciled-or-active", log.Fields{"device-id": device.Id})
+ return &empty.Empty{}, status.Errorf(codes.AlreadyExists, "handler exists: %s", device.Id)
}
return &empty.Empty{}, nil
}