[VOL-3631] Parametrizing KV_STORE path for TechProfiles and Onu data
Change-Id: I9598f3aa42d848786eaad89e260a71f9563bfa0c
diff --git a/internal/pkg/onuadaptercore/onu_device_entry.go b/internal/pkg/onuadaptercore/onu_device_entry.go
index 7cd20e5..adf630e 100644
--- a/internal/pkg/onuadaptercore/onu_device_entry.go
+++ b/internal/pkg/onuadaptercore/onu_device_entry.go
@@ -106,9 +106,10 @@
)
const (
+ // NOTE that this hardcoded to service/voltha as the MIB template is shared across stacks
cBasePathMibTemplateKvStore = "service/voltha/omci_mibs/go_templates"
cSuffixMibTemplateKvStore = "%s/%s/%s"
- cBasePathOnuKVStore = "service/voltha/openonu"
+ cBasePathOnuKVStore = "%s/openonu"
)
// OnuDeviceEvent - event of interest to Device Adapters and OpenOMCI State Machines
@@ -418,10 +419,11 @@
}
onuDeviceEntry.onuKVStorePath = onuDeviceEntry.deviceID
- onuDeviceEntry.onuKVStore = onuDeviceEntry.baseDeviceHandler.setBackend(cBasePathOnuKVStore)
+ baseKvStorePath := fmt.Sprintf(cBasePathOnuKVStore, dh.pOpenOnuAc.cm.Backend.PathPrefix)
+ onuDeviceEntry.onuKVStore = onuDeviceEntry.baseDeviceHandler.setBackend(baseKvStorePath)
if onuDeviceEntry.onuKVStore == nil {
logger.Errorw("Can't access onuKVStore - no backend connection to service",
- log.Fields{"device-id": dh.deviceID, "service": cBasePathOnuKVStore})
+ log.Fields{"device-id": dh.deviceID, "service": baseKvStorePath})
}
// Alarm Synchronization Database