[VOL-2890] Using olt-device-id in the path of a tech-profile
Change-Id: I4b572790e8b82ef903e557dee0ddf1a21859f188
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go
index faa86ed..42574d0 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go
@@ -222,7 +222,7 @@
defer b.Unlock()
formattedPath := b.makePath(key)
- logger.Debugw("putting-key", log.Fields{"key": key, "value": value, "path": formattedPath})
+ logger.Debugw("putting-key", log.Fields{"key": key, "path": formattedPath})
err := b.Client.Put(ctx, formattedPath, value)
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/endpoint_manager.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/endpoint_manager.go
index 4c13c76..1258382 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/endpoint_manager.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/endpoint_manager.go
@@ -56,9 +56,9 @@
// devices owned by that service need to be reconciled
IsDeviceOwnedByService(deviceID string, serviceType string, replicaNumber int32) (bool, error)
- // getReplicaAssignment returns the replica number of the service that owns the deviceID. This is used by the
+ // GetReplicaAssignment returns the replica number of the service that owns the deviceID. This is used by the
// test only
- getReplicaAssignment(deviceID string, serviceType string) (ReplicaID, error)
+ GetReplicaAssignment(deviceID string, serviceType string) (ReplicaID, error)
}
type service struct {
@@ -150,7 +150,7 @@
return m.getReplica() == ReplicaID(replicaNumber), nil
}
-func (ep *endpointManager) getReplicaAssignment(deviceID string, serviceType string) (ReplicaID, error) {
+func (ep *endpointManager) GetReplicaAssignment(deviceID string, serviceType string) (ReplicaID, error) {
owner, err := ep.getOwner(deviceID, serviceType)
if err != nil {
return 0, nil
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go
index 2c6e67b..4473389 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go
@@ -100,7 +100,7 @@
}
// Required uniPortName format
-var uniPortNameFormat = regexp.MustCompile(`^pon-{[0-9]+}/onu-{[0-9]+}/uni-{[0-9]+}$`)
+var uniPortNameFormat = regexp.MustCompile(`^olt-{[a-z0-9\-]+}/pon-{[0-9]+}/onu-{[0-9]+}/uni-{[0-9]+}$`)
/*
type InferredAdditionBWIndication int32
@@ -295,6 +295,10 @@
}
func (t *TechProfileMgr) GetTechProfileInstanceKVPath(techProfiletblID uint32, uniPortName string) string {
+ logger.Debugw("get-tp-instance-kv-path", log.Fields{
+ "uniPortName": uniPortName,
+ "tpId": techProfiletblID,
+ })
return fmt.Sprintf(t.config.TPInstanceKVPath, t.resourceMgr.GetTechnology(), techProfiletblID, uniPortName)
}
@@ -304,6 +308,8 @@
var err error
var kvResult *kvstore.KVPair
+ logger.Infow("get-tp-instance-form-kv-store", log.Fields{"path": path, "tpid": techProfiletblID})
+
kvResult, _ = t.config.KVBackend.Get(ctx, path)
if kvResult == nil {
logger.Infow("tp-instance-not-found-on-kv", log.Fields{"key": path})