Techprofile module to receive KVStore config from adapter,
Re-tested openolt-adapter & openonu-adapter for EAPOL/DHCP/HSIA on Edgecore OLT & TWSH ONT kit
Change-Id: I9cdf0365d888bfa619e1c16cac01970cc5aba856
diff --git a/common/techprofile/tech_profile.go b/common/techprofile/tech_profile.go
index 2879e99..e41e064 100644
--- a/common/techprofile/tech_profile.go
+++ b/common/techprofile/tech_profile.go
@@ -255,7 +255,7 @@
func newKVClient(storeType string, address string, timeout int) (kvstore.Client, error) {
- log.Infow("kv-store-type", log.Fields{"store": storeType})
+ log.Infow("kv-store", log.Fields{"storeType": storeType, "address": address})
switch storeType {
case "consul":
return kvstore.NewConsulClient(address, timeout)
@@ -265,10 +265,10 @@
return nil, errors.New("unsupported-kv-store")
}
-func NewTechProfile(resourceMgr iPonResourceMgr) (*TechProfileMgr, error) {
+func NewTechProfile(resourceMgr iPonResourceMgr, KVStoreType string, KVStoreHost string, KVStorePort int) (*TechProfileMgr, error) {
var techprofileObj TechProfileMgr
log.Debug("Initializing techprofile Manager")
- techprofileObj.config = NewTechProfileFlags()
+ techprofileObj.config = NewTechProfileFlags(KVStoreType, KVStoreHost, KVStorePort)
techprofileObj.config.KVBackend = techprofileObj.SetKVClient()
if techprofileObj.config.KVBackend == nil {
log.Error("Failed to initialize KV backend\n")