[VOL-3624] Templatizing the technology_profile path
Change-Id: I40f9041901a60efb8b9872612b21ee1b0cad82ef
diff --git a/pkg/techprofile/config.go b/pkg/techprofile/config.go
index bcec75e..07926c5 100644
--- a/pkg/techprofile/config.go
+++ b/pkg/techprofile/config.go
@@ -16,6 +16,7 @@
package techprofile
import (
+ "fmt"
"github.com/opencord/voltha-lib-go/v4/pkg/db"
"time"
)
@@ -32,7 +33,7 @@
defaultKVStoreTimeout = 5 * time.Second //in seconds
// Tech profile path prefix in kv store
- defaultKVPathPrefix = "service/voltha/technology_profiles"
+ defaultKVPathPrefix = "%s/technology_profiles"
// Tech profile path in kv store
defaultTechProfileKVPath = "%s/%d" // <technology>/<tech_profile_tableID>
@@ -109,7 +110,7 @@
DefaultNumGemPorts uint32
}
-func NewTechProfileFlags(KVStoreType string, KVStoreAddress string) *TechProfileFlags {
+func NewTechProfileFlags(KVStoreType string, KVStoreAddress string, basePathKvStore string) *TechProfileFlags {
// initialize with default values
var techProfileFlags = TechProfileFlags{
KVBackend: nil,
@@ -117,7 +118,7 @@
KVStoreType: KVStoreType,
KVStoreTimeout: defaultKVStoreTimeout,
DefaultTPName: defaultTechProfileName,
- TPKVPathPrefix: defaultKVPathPrefix,
+ TPKVPathPrefix: fmt.Sprintf(defaultKVPathPrefix, basePathKvStore),
TPVersion: defaultVersion,
TPFileKVPath: defaultTechProfileKVPath,
TPInstanceKVPath: defaultTPInstanceKVPath,