X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=common%2Futils.go;fp=common%2Futils.go;h=d849021d98dd8ab1bc054b5fecf73e40077144f0;hb=e36b158ce79c01567fd97c950ff6bccd2c84ce0d;hp=608130e01204d90e2d59772b61fb20829c7d48ce;hpb=5e9bd76649d8135ff755e9d3d8cf0d0e59e2ad03;p=ric-plt%2Fnodeb-rnib.git diff --git a/common/utils.go b/common/utils.go index 608130e..d849021 100644 --- a/common/utils.go +++ b/common/utils.go @@ -91,8 +91,20 @@ func ValidateAndBuildRanLoadInformationKey(inventoryName string) (string, error) func ValidateAndBuildE2TInstanceKey(address string) (string, error) { if address == "" { - return "", NewValidationError("#utils.ValidateAndBuildRanLoadInformationKey - an empty inventory name received") + return "", NewValidationError("#utils.ValidateAndBuildE2TInstanceKey - an empty E2T address received") } return fmt.Sprintf("E2TInstance:%s", address), nil -} \ No newline at end of file +} + +func MapE2TAddressesToKeys(addresses []string) []string { + + keys := []string{} + for _, v := range addresses { + if len(v) != 0 { + keys = append(keys, fmt.Sprintf("E2TInstance:%s", v)) + } + } + + return keys +}