[VOL-3644] fixed wrong topic names
The adapter_open_olt_topic is a configurable parameter from the command line
When sending InterAdapterMessage to the openonu-adapter, openolt-adapter
uses hardcoded "openolt" or deviceType fields as source topic name. This causes
not getting the responses from the openonu-adapter
if the topic name argument is set different than "openolt".
Change-Id: I0f88c1e8f9bfe322344c062478593444466869d4
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index 4e87682..44c6788 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -22,6 +22,9 @@
"encoding/hex"
"errors"
"fmt"
+ "strings"
+ "sync"
+
"github.com/opencord/voltha-lib-go/v4/pkg/flows"
"github.com/opencord/voltha-lib-go/v4/pkg/log"
tp "github.com/opencord/voltha-lib-go/v4/pkg/techprofile"
@@ -32,8 +35,6 @@
openoltpb2 "github.com/opencord/voltha-protos/v4/go/openolt"
tp_pb "github.com/opencord/voltha-protos/v4/go/tech_profile"
"github.com/opencord/voltha-protos/v4/go/voltha"
- "strings"
- "sync"
"github.com/opencord/voltha-openolt-adapter/internal/pkg/olterrors"
"google.golang.org/grpc/codes"
@@ -1687,13 +1688,13 @@
if sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx),
delGemPortMsg,
ic.InterAdapterMessageType_DELETE_GEM_PORT_REQUEST,
- f.deviceHandler.device.Type,
+ f.deviceHandler.openOLT.config.Topic,
onuDev.deviceType,
onuDev.deviceID,
onuDev.proxyDeviceID, ""); sendErr != nil {
return olterrors.NewErrCommunication("send-delete-gem-port-to-onu-adapter",
log.Fields{
- "from-adapter": f.deviceHandler.device.Type,
+ "from-adapter": f.deviceHandler.openOLT.config.Topic,
"to-adapter": onuDev.deviceType,
"onu-id": onuDev.deviceID,
"proxyDeviceID": onuDev.proxyDeviceID,
@@ -1728,13 +1729,13 @@
if sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx),
delTcontMsg,
ic.InterAdapterMessageType_DELETE_TCONT_REQUEST,
- f.deviceHandler.device.Type,
+ f.deviceHandler.openOLT.config.Topic,
onuDev.deviceType,
onuDev.deviceID,
onuDev.proxyDeviceID, ""); sendErr != nil {
return olterrors.NewErrCommunication("send-delete-tcont-to-onu-adapter",
log.Fields{
- "from-adapter": f.deviceHandler.device.Type,
+ "from-adapter": f.deviceHandler.openOLT.config.Topic,
"to-adapter": onuDev.deviceType, "onu-id": onuDev.deviceID,
"proxyDeviceID": onuDev.proxyDeviceID,
"device-id": f.deviceHandler.device.Id}, sendErr)
@@ -2331,14 +2332,14 @@
sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx),
tpDownloadMsg,
ic.InterAdapterMessageType_TECH_PROFILE_DOWNLOAD_REQUEST,
- f.deviceHandler.device.Type,
+ f.deviceHandler.openOLT.config.Topic,
onuDev.deviceType,
onuDev.deviceID,
onuDev.proxyDeviceID, "")
if sendErr != nil {
return olterrors.NewErrCommunication("send-techprofile-download-request",
log.Fields{
- "from-adapter": f.deviceHandler.device.Type,
+ "from-adapter": f.deviceHandler.openOLT.config.Topic,
"to-adapter": onuDev.deviceType,
"onu-id": onuDev.deviceID,
"proxyDeviceID": onuDev.proxyDeviceID}, sendErr)