[VOL-3783] Unifying service address and port for kafka and etcd
Change-Id: Id85168f46f93e445ee2bc9cf5cab493322f10efe
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index a9683dd..5e6e499 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -2039,14 +2039,14 @@
//setBackend provides a DB backend for the specified path on the existing KV client
func (dh *deviceHandler) setBackend(ctx context.Context, aBasePathKvStore string) *db.Backend {
- addr := dh.pOpenOnuAc.KVStoreHost + ":" + strconv.Itoa(dh.pOpenOnuAc.KVStorePort)
- logger.Debugw(ctx, "SetKVStoreBackend", log.Fields{"IpTarget": addr,
+
+ logger.Debugw(ctx, "SetKVStoreBackend", log.Fields{"IpTarget": dh.pOpenOnuAc.KVStoreAddress,
"BasePathKvStore": aBasePathKvStore, "device-id": dh.deviceID})
kvbackend := &db.Backend{
Client: dh.pOpenOnuAc.kvClient,
StoreType: dh.pOpenOnuAc.KVStoreType,
/* address config update acc. to [VOL-2736] */
- Address: addr,
+ Address: dh.pOpenOnuAc.KVStoreAddress,
Timeout: dh.pOpenOnuAc.KVStoreTimeout,
PathPrefix: aBasePathKvStore}
diff --git a/internal/pkg/onuadaptercore/openonu.go b/internal/pkg/onuadaptercore/openonu.go
index e933173..598be4a 100644
--- a/internal/pkg/onuadaptercore/openonu.go
+++ b/internal/pkg/onuadaptercore/openonu.go
@@ -54,8 +54,7 @@
cm *conf.ConfigManager
config *config.AdapterFlags
numOnus int
- KVStoreHost string
- KVStorePort int
+ KVStoreAddress string
KVStoreType string
KVStoreTimeout time.Duration
mibTemplatesGenerated map[string]bool
@@ -88,8 +87,7 @@
openOnuAc.adapterProxy = adapterProxy
openOnuAc.eventProxy = eventProxy
openOnuAc.kvClient = kvClient
- openOnuAc.KVStoreHost = cfg.KVStoreHost
- openOnuAc.KVStorePort = cfg.KVStorePort
+ openOnuAc.KVStoreAddress = cfg.KVStoreAddress
openOnuAc.KVStoreType = cfg.KVStoreType
openOnuAc.KVStoreTimeout = cfg.KVStoreTimeout
openOnuAc.mibTemplatesGenerated = make(map[string]bool)